ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Consideration of timezone differences in pre-filling default time in an entry's date field

Open steveparks opened this issue 1 year ago • 1 comments

The Date field on collections with the time option selected pre-fills with the current date and time when creating a new entry... which is ideal in the majority of cases. Editors just leave it as the default with the idea it'll be published straight away.

However, it appears to pre-fill this based on the timezone of the user's machine, rather than the timezone the site is set to.

Therefore, when an editor is in a different timezone to the site, and creates a post with the idea of publishing it straight away, they then think there's a problem when it isn't live and just shows as scheduled.

For an example, a site that has London/GMT set as its timezone, and an editor that is working in Paris/CET. The editor will create an entry that will prefill with 15:30. They publish the entry at 15:40. But to the site the current time is 14:40, so it shows as scheduled for a future time, and doesn't appear on the site.

It would be good to have a way to either:

  1. Set the Date field pre-fill to use the site's timezone current time when pre-filling, rather than the user's local time; or
  2. Offer an option on the date field in the collections blueprint to select what timezone it will use to set the prefill with

steveparks avatar Aug 16 '24 18:08 steveparks

New Statamic user here and just hit this issue. I was confused why publishing new entries scheduled them 1 hour from now. This issue seems to make it clear. Did you find any workarounds? I'm wondering about somehow setting the default to something timezone-specific/local instead of now.

Edit: I just realized it's the right time, but it's a day ahead.

JiveDig avatar Oct 03 '24 02:10 JiveDig

We've made a bunch of timezone-related improvements in https://github.com/statamic/cms/pull/11409, which'll be released as part of Statamic 6.

The date fieldtype will display dates using the user's timezone, but they'll be converted to the app's timezone upon save so the times should match up.

duncanmcclean avatar Mar 27 '25 12:03 duncanmcclean