Skip to content

MWPW-196529: display start datetime in user local timezone with epoch input#635

Open
michaelready wants to merge 2 commits into
devfrom
MWPW-196529
Open

MWPW-196529: display start datetime in user local timezone with epoch input#635
michaelready wants to merge 2 commits into
devfrom
MWPW-196529

Conversation

@michaelready

@michaelready michaelready commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

JIRA

MWPW-196529

Summary

Converts the schedule-maker block editor's start datetime input to display in the user's local timezone instead of UTC, and adds a bidirectional epoch (ms) input field.

  • Local timezone display (BlockEditor.js): Datetime-local input now shows time in the user's detected browser timezone via Intl.DateTimeFormat. Label updated from "Start Date and Time UTC" to "Start Date and Time (America/Los_Angeles)" (or whatever the detected timezone is). Falls back to UTC if timezone cannot be detected, which is clearly indicated in the label
  • DST-safe conversion (BlockEditor.js): localInputToEpoch() probes the actual UTC offset for the entered datetime via Intl before converting to epoch ms — handles US daylight saving time transitions correctly. Storage format is unchanged; DB always receives epoch milliseconds
  • Epoch (ms) input (BlockEditor.js): New number input field showing the raw epoch millisecond value. Bidirectionally synced — editing either the datetime picker or the epoch field updates the other. Accepts all existing timestamp formats from the sheet importer (2025-06-16T09:00:00Z, 2025-06-16T09:00:00-07:00, 1750064400000)
  • PT hint (BlockEditor.js, schedule-maker.css): When the user's timezone is not PT, a small secondary line appears below the datetime picker showing the equivalent PT time in MM/DD/YYYY, HH:MM AM/PM format
  • Removed PT/local preview (BlockEditor.js, schedule-maker.css): Removed the old PT and local time string preview block and its associated CSS rules (.sm-editor__block-datetime-preview, .sm-editor__block-datetime-preview-label, .sm-editor__block-datetime-preview-item)

Test Plan

  • Open a block with an existing startDateTime — datetime input should show the correct local time, epoch field should show the ms value
  • Change the datetime picker — epoch field should update to the matching ms value
  • Change the epoch field — datetime picker should update to the matching local time
  • Verify saving and reloading a schedule preserves the correct UTC timestamp
  • Test with browser timezone set to UTC — label should read "Start Date and Time (UTC)" and PT hint should appear below the datetime picker
  • Test with browser timezone set to America/Los_Angeles — PT hint should not appear
  • Import a sheet with date strings (2025-06-16T09:00:00Z, 2025-06-16T09:00:00-07:00) and epoch ms values — all should display correctly after import

Made with Claude Code

… input

- datetime-local input now shows time in the user's detected timezone (falls back to UTC)
- label updated to indicate the active timezone
- added bidirectional epoch (ms) input field
- DST-safe local→UTC conversion via Intl API
- removed PT/local preview string display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jun 20, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@michaelready michaelready added do not merge Still waiting for something and removed do not merge Still waiting for something labels Jun 20, 2026
- PT hint now displays as MM/DD/YYYY, HH:MM AM/PM
- fix epoch input dropping below datetime input when PT hint is visible

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant