Added granular control of expiration + 12/24 hour modes

This commit is contained in:
Steve Tautonico
2022-10-14 18:14:46 -04:00
parent 56349c6f4c
commit 5988d5ffcc
5 changed files with 199 additions and 131 deletions

View File

@@ -14,6 +14,9 @@ import { useRouter } from "next/router";
import { Copy } from "tabler-icons-react";
import { Share } from "../../types/share.type";
import toast from "../../utils/toast.util";
import getConfig from "next/config";
const {publicRuntimeConfig} = getConfig();
const showCompletedUploadModal = (
modals: ModalsContextProps,
@@ -62,7 +65,10 @@ 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 ${moment(share.expiration).format("LLL")}`}
: `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")}`}
</Text>
<Button