From 53750d263622ec4583d5db4f06f2c9164cee955f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Santos?= Date: Tue, 17 Mar 2026 16:51:44 +0000 Subject: [PATCH 1/2] Fix PostDate using browser timezone instead of WordPress site timezone --- components/post-date/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/post-date/index.tsx b/components/post-date/index.tsx index 0a1707ef..edf36b7e 100644 --- a/components/post-date/index.tsx +++ b/components/post-date/index.tsx @@ -38,6 +38,12 @@ interface PostDateProps { */ format?: string; + /** + * The timezone to use for formatting. + * When not provided, dateI18n falls back to the WordPress site timezone. + */ + timezone?: string; + /** * Remaining props to pass to the time element. */ @@ -47,6 +53,7 @@ interface PostDateProps { export const PostDate: React.FC = ({ placeholder = __('No date set', 'tenup'), format, + timezone, ...rest }) => { const { postId, postType, isEditable } = usePost(); @@ -54,7 +61,6 @@ export const PostDate: React.FC = ({ const [date, setDate] = useEntityProp('postType', postType, 'date', postId as string); const [siteFormat] = useEntityProp('root', 'site', 'date_format'); const settings: DateSettings = getSettings(); - const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; const resolvedFormat = format || siteFormat || settings.formats.date; From 15e85ee1a341a5934d57a8d3751f89d2ab3d2844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Santos?= Date: Tue, 17 Mar 2026 16:54:50 +0000 Subject: [PATCH 2/2] Update documentation --- components/post-date/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/components/post-date/readme.md b/components/post-date/readme.md index accf1d71..65ace4ab 100644 --- a/components/post-date/readme.md +++ b/components/post-date/readme.md @@ -23,4 +23,5 @@ function BlockEdit() { | ---------- | ----------------- | -------- | -------------------------------------------------------------- | | `placeholder` | `string` | `No date set` | | | `format` | `string` | | Uses the WordPress date format setting of the site | +| `timezone` | `string` | | Uses the WordPress site timezone when not provided | | `...rest` | `object` | `{}` | |