Skip to content

Commit 1018655

Browse files
authored
fix: use local time in getStartOfDay/getEndOfDay to prevent DST date shift (#520) (#521)
1 parent 735c469 commit 1018655

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Date/dateUtils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ export function useInputFormatter({ locale }: { locale: string | undefined }) {
272272

273273
export function getStartOfDay(d: Date): Date {
274274
const startOfDay = new Date(d)
275-
startOfDay.setUTCHours(0, 0, 0, 0)
275+
startOfDay.setHours(0, 0, 0, 0)
276276
return startOfDay
277277
}
278278

279279
export function getEndOfDay(d: Date): Date {
280280
const endOfDay = new Date(d)
281-
endOfDay.setUTCHours(23, 59, 59, 999)
281+
endOfDay.setHours(23, 59, 59, 999)
282282
return endOfDay
283283
}
284284

0 commit comments

Comments
 (0)