Skip to content

Commit d43f5b1

Browse files
committed
refactor: fix issues created from ios multiple performance fix
1 parent fd59475 commit d43f5b1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Date/dateUtils.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,15 @@ export function useInputFormatter({ locale }: { locale: string | undefined }) {
220220
}
221221

222222
export function getStartOfDay(d: Date): Date {
223-
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0)
223+
const startOfDay = new Date(d)
224+
startOfDay.setUTCHours(0, 0, 0, 0)
225+
return startOfDay
224226
}
225227

226228
export function getEndOfDay(d: Date): Date {
227-
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59)
229+
const endOfDay = new Date(d)
230+
endOfDay.setUTCHours(23, 59, 59, 999)
231+
return endOfDay
228232
}
229233

230234
export function useInputFormat({

0 commit comments

Comments
 (0)