Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/dataviews/src/field-types/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ function getValueFormatted< Item >( {
formatDatetime = field.format as Required< FormatDatetime >;
}

return dateI18n( formatDatetime.datetime, getDate( value ) );
// Use the browser's local timezone to display the datetime value.
// The filter input (datetime-local) operates in browser local time, converting
// the user's selection to a UTC ISO string for storage. We must convert back to
// local time here so the filter chip shows the same time the user originally selected.
const localTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
return dateI18n( formatDatetime.datetime, getDate( value ), localTimezone );
}

const sort = ( a: any, b: any, direction: SortDirection ) => {
Expand Down
Loading