Opened 3 weeks ago

Closed 11 days ago

#37074 closed Bug (fixed)

"Today" in admin datetime widget differs from "today" in calendar picker display

Reported by: Jacob Walls Owned by: SnippyCodes
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

The calendar widget for date fields in the admin has a discrepancy in how "today" is calculated.

The widget input treats "today" as in server time.

But the highlighting in bold of "today's" entry on the calendar squares (class = "today") is calculated in local time. (After #36459 this will also affect an aria-label on that square.)

This means that for a TIME_ZONE of UTC+12 (TIME_ZONE = "Pacific/Nauru") and a local time of something else (for me, America/NewYork), the "Today" button produces the date in Nauru, but the previous date is highlighted with class="today".

The proposal for #35951 passes the server timezone to the frontend. Once that is in place, we can use it to remove this discrepancy by making "today" always calculated the same.

Change History (7)

comment:1 by Jacob Walls, 3 weeks ago

Ah, we probably don't need to wait for #35951, as we already have a body data attribute with a server offset.

comment:2 by Tim Graham, 3 weeks ago

Triage Stage: UnreviewedAccepted

comment:3 by SnippyCodes, 3 weeks ago

Has patch: set
Owner: set to SnippyCodes
Status: newassigned

comment:4 by Jacob Walls, 3 weeks ago

Needs tests: set

comment:5 by Jacob Walls, 13 days ago

Patch needs improvement: set

comment:6 by Jacob Walls, 11 days ago

Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 by Jacob Walls <jacobtylerwalls@…>, 11 days ago

Resolution: fixed
Status: assignedclosed

In 9d4ee17:

Fixed #37074 -- Synced admin calendar today highlight with server time.

Note: See TracTickets for help on using tickets.
Back to Top