diff --git a/frontend/.env.example b/frontend/.env.example index 7e65299c..dbda9022 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1,4 +1,3 @@ SHOW_HOME_PAGE=true ALLOW_REGISTRATION=true MAX_FILE_SIZE=1000000000 -TWELVE_HOUR_TIME=false diff --git a/frontend/next.config.js b/frontend/next.config.js index dea14c00..f78b7433 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -6,7 +6,6 @@ const nextConfig = { SHOW_HOME_PAGE: process.env.SHOW_HOME_PAGE, MAX_FILE_SIZE: process.env.MAX_FILE_SIZE, BACKEND_URL: process.env.BACKEND_URL, - TWELVE_HOUR_TIME: process.env.TWELVE_HOUR_TIME } } diff --git a/frontend/src/components/share/CreateUploadModalBody.tsx b/frontend/src/components/share/CreateUploadModalBody.tsx index 04507633..f4dd7d4d 100644 --- a/frontend/src/components/share/CreateUploadModalBody.tsx +++ b/frontend/src/components/share/CreateUploadModalBody.tsx @@ -1,8 +1,8 @@ import { Accordion, Button, - Col, Checkbox, + Col, Grid, NumberInput, PasswordInput, @@ -13,13 +13,10 @@ import { } from "@mantine/core"; import { useForm, yupResolver } from "@mantine/form"; import { useModals } from "@mantine/modals"; +import moment from "moment"; import * as yup from "yup"; import shareService from "../../services/share.service"; import { ShareSecurity } from "../../types/share.type"; -import moment from "moment"; -import getConfig from "next/config"; - -const { publicRuntimeConfig } = getConfig(); const PreviewExpiration = ({ form }: { form: any }) => { const value = form.values.never_expires @@ -34,14 +31,7 @@ const PreviewExpiration = ({ form }: { form: any }) => { ) .toDate(); - if (publicRuntimeConfig.TWELVE_HOUR_TIME === "true") - return `This share will expire on ${moment(expirationDate).format( - "MMMM Do YYYY, h:mm a" - )}`; - else - return `This share will expire on ${moment(expirationDate).format( - "MMMM DD YYYY, HH:mm" - )}`; + return `This share will expire on ${moment(expirationDate).format("LLL")}`; }; const CreateUploadModalBody = ({ diff --git a/frontend/src/components/upload/showCompletedUploadModal.tsx b/frontend/src/components/upload/showCompletedUploadModal.tsx index 68c32ae5..ac7de640 100644 --- a/frontend/src/components/upload/showCompletedUploadModal.tsx +++ b/frontend/src/components/upload/showCompletedUploadModal.tsx @@ -62,11 +62,9 @@ const Body = ({ share }: { share: Share }) => { {/* If our share.expiration is timestamp 0, show a different message */} {moment(share.expiration).unix() === 0 ? "This share will never expire." - : `This share will expire on ${ - publicRuntimeConfig.TWELVE_HOUR_TIME === "true" - ? moment(share.expiration).format("MMMM Do YYYY, h:mm a") - : moment(share.expiration).format("MMMM DD YYYY, HH:mm") - }`} + : `This share will expire on ${moment(share.expiration).format( + "LLL" + )}`}