diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx
index 629c046c..354f4394 100644
--- a/web/components/contract/contract-details.tsx
+++ b/web/components/contract/contract-details.tsx
@@ -233,7 +233,7 @@ export function ContractDetails(props: {
{resolvedDate}
@@ -322,7 +322,7 @@ function EditableCloseDate(props: {
) : (
Date.now() ? 'Trading ends:' : 'Trading ended:'}
- time={dayJsCloseTime}
+ time={closeTime}
>
{isSameYear
? dayJsCloseTime.format('MMM D')
diff --git a/web/components/datetime-tooltip.tsx b/web/components/datetime-tooltip.tsx
index d820e728..c81d5d88 100644
--- a/web/components/datetime-tooltip.tsx
+++ b/web/components/datetime-tooltip.tsx
@@ -1,15 +1,12 @@
-import dayjs, { Dayjs } from 'dayjs'
-import utc from 'dayjs/plugin/utc'
-import timezone from 'dayjs/plugin/timezone'
-import advanced from 'dayjs/plugin/advancedFormat'
import { Tooltip } from './tooltip'
-dayjs.extend(utc)
-dayjs.extend(timezone)
-dayjs.extend(advanced)
+const FORMATTER = new Intl.DateTimeFormat('default', {
+ dateStyle: 'medium',
+ timeStyle: 'long',
+})
export function DateTimeTooltip(props: {
- time: Dayjs
+ time: number
text?: string
className?: string
children?: React.ReactNode
@@ -17,7 +14,7 @@ export function DateTimeTooltip(props: {
}) {
const { className, time, text, noTap } = props
- const formattedTime = time.format('MMM DD, YYYY hh:mm a z')
+ const formattedTime = FORMATTER.format(time)
const toolTip = text ? `${text} ${formattedTime}` : formattedTime
return (
diff --git a/web/components/feed/copy-link-date-time.tsx b/web/components/feed/copy-link-date-time.tsx
index 8238d3e3..cea8300a 100644
--- a/web/components/feed/copy-link-date-time.tsx
+++ b/web/components/feed/copy-link-date-time.tsx
@@ -7,7 +7,6 @@ import { fromNow } from 'web/lib/util/time'
import { ToastClipboard } from 'web/components/toast-clipboard'
import { LinkIcon } from '@heroicons/react/outline'
import clsx from 'clsx'
-import dayjs from 'dayjs'
export function CopyLinkDateTimeComponent(props: {
prefix: string
@@ -18,7 +17,6 @@ export function CopyLinkDateTimeComponent(props: {
}) {
const { prefix, slug, elementId, createdTime, className } = props
const [showToast, setShowToast] = useState(false)
- const time = dayjs(createdTime)
function copyLinkToComment(
event: React.MouseEvent
@@ -32,7 +30,7 @@ export function CopyLinkDateTimeComponent(props: {
}
return (