[META] Add timezone support to core date fields

Created on 1 December 2020, about 4 years ago
Updated 31 January 2024, 11 months ago

Problem/Motivation

✨ [PP-1] Add ability to select a timezone for datetime field Postponed currently has 117 followers and we're on comment #290. The latest patch is 98k. It risks never being completed. The scope is too huge, there are too many moving pieces. It needs to be split up and tackled in smaller, more actionable pieces.

Proposed resolution

@jonathanshaw proposed a way to split it up into an actionable plan at #2632040-107: [PP-1] Add ability to select a timezone for datetime field β†’ , and other users (@dww, @WidgetsBurritos, @amjad1233, et al) support the approach.

This issue is a parent meta plan to coordinate the moving pieces. Once this is finally complete, we can reply at the parent and mark it fixed, notifying all the followers when the feature is working and committed.

High-level overview of the plan:

  • Refactor datetime formatters to simplify the logic.
  • Give settings to the datetime widgets (shared in common with the formatters, and date_range) that allow sitebuilders to control the time zone used to interpret input.
  • Add a new (optional) property to the date field (and date_range) that stores the preferred time zone.
  • Create thorough tests to verify that all this arcane time zone handling is working correctly everywhere.

Remaining tasks

Child issues

  1. πŸ“Œ Create TimezoneFieldTest class Needs work
  2. #3185729: Refactor datetime formatters β†’
  3. #3185730: Move formatter timezone settings into a trait β†’
  4. #3185733: Apply timezone trait to datetime widgets β†’
  5. #3185734: Add per-instance datetime timezone storage β†’

General points (needs triage)

User interface changes

A timezone handling configuration drop down on field storage configuration, and if configured for per-date storage, a timezone selector on the date widget. See child issues for details.

Screenshots

API changes

  • The datetime form element will have an optional #expose_timezone boolean, that if TRUE, will add a timezone selector to the element.
  • Date time widgets and formatters will have various new methods. Possibly getDefaultValue() should be public.

See child issues for details.

Data model changes

Datetime storage will store a timezone per date.

See child issues.

Release notes snippet

@todo

🌱 Plan
Status

Active

Version

11.0 πŸ”₯

Component
DatetimeΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024