diff --git a/packages/common/src/adapters/collection.ts b/packages/common/src/adapters/collection.ts index 831267c0f12..5b4c9aa340d 100644 --- a/packages/common/src/adapters/collection.ts +++ b/packages/common/src/adapters/collection.ts @@ -14,7 +14,7 @@ import { type UpdateAlbumRequestBody, type UpdatePlaylistRequestBody } from '@audius/sdk' -import dayjs from 'dayjs' +import dayjs from '~/utils/dayjs' import { omit } from 'lodash' import snakecaseKeys from 'snakecase-keys' diff --git a/packages/common/src/adapters/notification.ts b/packages/common/src/adapters/notification.ts index e5f83d6a5ad..5074e608234 100644 --- a/packages/common/src/adapters/notification.ts +++ b/packages/common/src/adapters/notification.ts @@ -10,7 +10,7 @@ import { instanceOfPlaylistMilestoneNotificationActionData, instanceOfTrackMilestoneNotificationActionData } from '@audius/sdk' -import dayjs from 'dayjs' +import dayjs from '~/utils/dayjs' import { BadgeTier, type ID } from '~/models' import type { ChallengeRewardID } from '~/models/AudioRewards' diff --git a/packages/common/src/adapters/track.ts b/packages/common/src/adapters/track.ts index 9100427edc5..e183755e066 100644 --- a/packages/common/src/adapters/track.ts +++ b/packages/common/src/adapters/track.ts @@ -14,7 +14,7 @@ import { OptionalId } from '@audius/sdk' import camelcaseKeys from 'camelcase-keys' -import dayjs from 'dayjs' +import dayjs from '~/utils/dayjs' import { omit, pick, mapValues } from 'lodash' import snakecaseKeys from 'snakecase-keys' diff --git a/packages/common/src/utils/timeUtil.ts b/packages/common/src/utils/timeUtil.ts index b83a3f3dce7..037016b4563 100644 --- a/packages/common/src/utils/timeUtil.ts +++ b/packages/common/src/utils/timeUtil.ts @@ -1,5 +1,4 @@ -import dayjs from 'dayjs' -import advancedFormat from 'dayjs/plugin/advancedFormat' +import dayjs from './dayjs' export const MS_IN_S = 1000 export const S_IN_MIN = 60 @@ -35,8 +34,6 @@ export const getLargestTimeUnitText = (time: Date) => { return unit ? `${Math.floor(diff / timeUnitMsMap[unit])}${unit}` : 'just now' } -dayjs.extend(advancedFormat) - export const formatDateWithTimezoneOffset = (date: string): string => { return dayjs.utc(date).local().format('M/D/YY') } diff --git a/packages/web/src/pages/comment-history/components/desktop/CommentHistoryPage.tsx b/packages/web/src/pages/comment-history/components/desktop/CommentHistoryPage.tsx index 049d56f5286..0f2246bf99f 100644 --- a/packages/web/src/pages/comment-history/components/desktop/CommentHistoryPage.tsx +++ b/packages/web/src/pages/comment-history/components/desktop/CommentHistoryPage.tsx @@ -8,6 +8,7 @@ import { } from '@audius/common/api' import { Name } from '@audius/common/models' import { profilePage } from '@audius/common/src/utils/route' +import { dayjs } from '@audius/common/utils' import { Box, Button, @@ -20,7 +21,6 @@ import { Text, TextLink } from '@audius/harmony' -import dayjs from 'dayjs' import InfiniteScroll from 'react-infinite-scroller' import { useNavigate } from 'react-router'