From 1a174b6c7dfb5c31d79f2d0045cd0833b2c21e36 Mon Sep 17 00:00:00 2001 From: Maksym Viter Date: Mon, 2 Dec 2024 15:16:18 +0000 Subject: [PATCH 1/2] add 15 hours to day in datepicker to avoid the DTS impact --- packages/components/src/date-time/date/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/src/date-time/date/index.tsx b/packages/components/src/date-time/date/index.tsx index ca093f9d70847b..8b20f33600a139 100644 --- a/packages/components/src/date-time/date/index.tsx +++ b/packages/components/src/date-time/date/index.tsx @@ -168,6 +168,7 @@ export function DatePicker( { if ( ! isSameMonth( day, viewing ) ) { return null; } + day.setHours( 15 ); return ( Date: Mon, 2 Dec 2024 17:49:49 +0100 Subject: [PATCH 2/2] move hours shift closer to the button label print --- packages/components/src/date-time/date/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/src/date-time/date/index.tsx b/packages/components/src/date-time/date/index.tsx index 8b20f33600a139..f63ddd3d834ce2 100644 --- a/packages/components/src/date-time/date/index.tsx +++ b/packages/components/src/date-time/date/index.tsx @@ -168,7 +168,6 @@ export function DatePicker( { if ( ! isSameMonth( day, viewing ) ) { return null; } - day.setHours( 15 ); return ( - { dateI18n( 'j', day, -day.getTimezoneOffset() ) } + { dateI18n( 'j', shiftedDay, -shiftedDay.getTimezoneOffset() ) } ); }