Skip to content

Commit

Permalink
chore(deps): update date-fns, date-fns-tz (#7546)
Browse files Browse the repository at this point in the history
* fix: regression on dropdown input, workflow save action step component (#7754)

* fix: dropdown input regression

* fix: flakey dates on Billing page

* fix: remove addition margin, chakra v2 likely fixed the margin gap problem on dividers

* chore: replace zonedTimeToUtc to fromZonedTime

* fix: ts errors
  • Loading branch information
KenLSM authored Oct 10, 2024
1 parent bc199c8 commit b3cafbb
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 68 deletions.
62 changes: 42 additions & 20 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"country-flag-icons": "^1.4.19",
"csv-string": "^4.1.0",
"cuid": "^2.1.8",
"date-fns": "^2.27.0",
"date-fns-tz": "^1.3.4",
"date-fns": "^3.6.0",
"date-fns-tz": "^3.1.3",
"dayjs": "^1.10.7",
"dayzed": "^3.2.2",
"dedent": "^0.7.0",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/DatePicker/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { InputProps } from '@chakra-ui/react'
import { Locale } from 'date-fns'

export interface DatePickerBaseProps
extends Omit<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
useBreakpointValue,
useDisclosure,
} from '@chakra-ui/react'
import format from 'date-fns/format'
import { format } from 'date-fns'

import { SeenFlags } from '~shared/types'
import { AdminFormDto, FormResponseMode } from '~shared/types/form/form'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compareAsc, isValid, parseISO } from 'date-fns'
import { formatInTimeZone, zonedTimeToUtc } from 'date-fns-tz'
import { formatInTimeZone, fromZonedTime } from 'date-fns-tz'
import type { Dictionary } from 'lodash'
import { keyBy } from 'lodash'
import type { Merge } from 'type-fest'
Expand Down Expand Up @@ -179,8 +179,8 @@ export class EncryptedResponseCsvGenerator extends CsvGenerator {
*/
private _dateComparator(firstDate: string, secondDate: string): number {
// cast to Asia/Singapore to ensure both dates are of the same timezone
const first = zonedTimeToUtc(firstDate, 'Asia/Singapore')
const second = zonedTimeToUtc(secondDate, 'Asia/Singapore')
const first = fromZonedTime(firstDate, 'Asia/Singapore')
const second = fromZonedTime(secondDate, 'Asia/Singapore')
return compareAsc(first, second)
}
}
34 changes: 22 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"cookie-parser": "~1.4.6",
"csv-string": "^4.1.1",
"cuid": "^2.1.8",
"date-fns": "^2.30.0",
"date-fns": "^3.6.0",
"dd-trace": "^5.22.0",
"dedent-js": "~1.0.1",
"dotenv": "^16.4.5",
Expand Down
34 changes: 6 additions & 28 deletions shared/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"dependencies": {
"date-fns": "^2.26.0",
"date-fns": "^3.6.0",
"json-stringify-safe": "^5.0.1",
"jszip": "^3.7.1",
"libphonenumber-js": "^1.10.48",
Expand Down

0 comments on commit b3cafbb

Please sign in to comment.