From 7307a4475a6950e272fafda74e0cb05aef620cf8 Mon Sep 17 00:00:00 2001 From: Brijesh Date: Thu, 6 Aug 2026 16:27:34 -0700 Subject: [PATCH 1/4] #1376 - align plan version history dates --- .../versionsList/VersionsDropdownList.tsx | 11 +++-------- src/utils/format/date.ts | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx b/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx index a5f3cffc..e1c2da4c 100644 --- a/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx +++ b/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx @@ -7,12 +7,11 @@ import TableCell from '@mui/material/TableCell'; import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; import Typography from '@mui/material/Typography'; -import moment from 'moment'; import classnames from 'classnames'; import Status from '../../common/Status'; import { useUser } from '../../../providers/UserProvider'; import { PrimaryButton, MuiIcon } from '../../common/'; -import { axios, getAuthHeaderConfig } from '../../../utils'; +import { axios, getAuthHeaderConfig, formatPlanVersionDate } from '../../../utils'; import * as API from '../../../constants/api'; import AttachmentsList from './AttachmentsList'; import { ATTACHMENT_TYPE } from '../../../constants/variables'; @@ -52,13 +51,9 @@ const VersionRow = ({ option, user }: { option: any; user: any }) => { {option.version.amendmentType} {option.version.submittedBy} - - {option.version.createdAt ? moment(option.version.createdAt).format('MMM DD YYYY h:mm a') : ''} - + {formatPlanVersionDate(option.version.createdAt)} {option.version.approvedBy} - - {option.version.approvedAt === null ? '' : moment(option.version.approvedAt).format('MMM DD YYYY h:mm a')} - + {formatPlanVersionDate(option.version.approvedAt)} + date ? dayjs.utc(date).tz(PLAN_TIMEZONE).format('MMM DD YYYY h:mm a') : ''; + /** * Present the date time in a more readable way * From 9a566f202e3e38ed8f2c9f4274e510183c31acc2 Mon Sep 17 00:00:00 2001 From: Brijesh Date: Fri, 7 Aug 2026 12:24:54 -0700 Subject: [PATCH 2/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/utils/format/date.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/format/date.ts b/src/utils/format/date.ts index ee236c2d..a3f9e101 100644 --- a/src/utils/format/date.ts +++ b/src/utils/format/date.ts @@ -1,5 +1,5 @@ import moment from 'moment'; -import * as dayjs from 'dayjs'; +import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; import { DATE_FORMAT } from '../../constants/variables'; From c3f769a764148c0d60446954ba1c42da4570c77e Mon Sep 17 00:00:00 2001 From: Brijesh Date: Fri, 7 Aug 2026 12:30:29 -0700 Subject: [PATCH 3/4] #1376 - move plan version date formatting out of shared date utils --- .../versionsList/VersionsDropdownList.tsx | 3 ++- src/utils/format/date.ts | 11 ----------- src/utils/format/planVersionDate.ts | 11 +++++++++++ 3 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 src/utils/format/planVersionDate.ts diff --git a/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx b/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx index e1c2da4c..a55d44f1 100644 --- a/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx +++ b/src/components/rangeUsePlanPage/versionsList/VersionsDropdownList.tsx @@ -11,7 +11,8 @@ import classnames from 'classnames'; import Status from '../../common/Status'; import { useUser } from '../../../providers/UserProvider'; import { PrimaryButton, MuiIcon } from '../../common/'; -import { axios, getAuthHeaderConfig, formatPlanVersionDate } from '../../../utils'; +import { axios, getAuthHeaderConfig } from '../../../utils'; +import { formatPlanVersionDate } from '../../../utils/format/planVersionDate'; import * as API from '../../../constants/api'; import AttachmentsList from './AttachmentsList'; import { ATTACHMENT_TYPE } from '../../../constants/variables'; diff --git a/src/utils/format/date.ts b/src/utils/format/date.ts index a3f9e101..aa93a066 100644 --- a/src/utils/format/date.ts +++ b/src/utils/format/date.ts @@ -1,18 +1,7 @@ import moment from 'moment'; -import dayjs from 'dayjs'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; import { DATE_FORMAT } from '../../constants/variables'; import { NOT_PROVIDED } from '../../constants/strings'; -dayjs.extend(utc); -dayjs.extend(timezone); - -export const PLAN_TIMEZONE = 'America/Vancouver'; - -export const formatPlanVersionDate = (date: string | Date | null | undefined): string => - date ? dayjs.utc(date).tz(PLAN_TIMEZONE).format('MMM DD YYYY h:mm a') : ''; - /** * Present the date time in a more readable way * diff --git a/src/utils/format/planVersionDate.ts b/src/utils/format/planVersionDate.ts new file mode 100644 index 00000000..83f68c4a --- /dev/null +++ b/src/utils/format/planVersionDate.ts @@ -0,0 +1,11 @@ +import * as dayjs from 'dayjs'; +import utc from 'dayjs/plugin/utc'; +import timezone from 'dayjs/plugin/timezone'; + +dayjs.extend(utc); +dayjs.extend(timezone); + +export const PLAN_TIMEZONE = 'America/Vancouver'; + +export const formatPlanVersionDate = (date: string | Date | null | undefined): string => + date ? dayjs.utc(date).tz(PLAN_TIMEZONE).format('MMM DD YYYY h:mm a') : ''; From ca9269f84b2c09d275d603b48b66c861b388f160 Mon Sep 17 00:00:00 2001 From: Brijesh Date: Fri, 7 Aug 2026 12:42:40 -0700 Subject: [PATCH 4/4] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/utils/format/planVersionDate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/format/planVersionDate.ts b/src/utils/format/planVersionDate.ts index 83f68c4a..e0fab9f7 100644 --- a/src/utils/format/planVersionDate.ts +++ b/src/utils/format/planVersionDate.ts @@ -1,4 +1,4 @@ -import * as dayjs from 'dayjs'; +import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone';