Skip to content

WIP - datepicker.js — 3 fixes:#1055

Open
onewheelskyward wants to merge 1 commit into
mainfrom
issue-1054/date-picker-and-timezones
Open

WIP - datepicker.js — 3 fixes:#1055
onewheelskyward wants to merge 1 commit into
mainfrom
issue-1054/date-picker-and-timezones

Conversation

@onewheelskyward
Copy link
Copy Markdown
Contributor

  • Added getPacificToday() using Intl.DateTimeFormat with timeZone: 'America/Los_Angeles', which returns the correct Pacific date regardless of the browser's timezone
  • isToday() now compares against the Pacific date instead of the local date
  • toUtcString() no longer calls .utc() — converting local-midnight dayjs objects to UTC was shifting dates backward for users east of UTC (e.g., a user clicking "Jan 5" in the calendar would accidentally store Jan 4)
  • initDatePicker() now starts from the Pacific "today" date

addevent.js — 1 fix:

  • 'hh:mm:ss' → 'HH:mm:ss' in the preview time parser; the lowercase hh is 12-hour format and would misparse afternoon times like "14:30:00", causing the preview to display wrong end times for PM events

main.js — 1 fix:

  • Same 'hh:mm:ss' → 'HH:mm:ss' fix for event time display in the calendar list view

  - Added getPacificToday() using Intl.DateTimeFormat with timeZone: 'America/Los_Angeles', which returns the correct Pacific date regardless of the browser's timezone
  - isToday() now compares against the Pacific date instead of the local date
  - toUtcString() no longer calls .utc() — converting local-midnight dayjs objects to UTC was shifting dates backward for users east of UTC (e.g., a user clicking "Jan 5" in the calendar
  would accidentally store Jan 4)
  - initDatePicker() now starts from the Pacific "today" date

  addevent.js — 1 fix:
  - 'hh:mm:ss' → 'HH:mm:ss' in the preview time parser; the lowercase hh is 12-hour format and would misparse afternoon times like "14:30:00", causing the preview to display wrong end times
  for PM events

  main.js — 1 fix:
  - Same 'hh:mm:ss' → 'HH:mm:ss' fix for event time display in the calendar list view
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