The outline tab's course end and certificate status alerts ignore the learner's time zone preference
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, react
- Domain
- frontend
Research direction
Start with useCourseEndAlert and useCertificateStatusAlert in the outline tab, then compare their time zone reads with CourseDates.jsx and check how CertificateStatusAlert.jsx passes formatting arguments to its FormattedDate elements. The issue also describes the outline test suite and the relevant test cases to add. Done means both alerts use the course metadata time zone when present and the browser time zone when it is absent; the issue does not name the test file.
Written by the indexing model from the issue text.
Description
The outline tab's course end alert and certificate status alert ignore the learner's time zone preference. Their dates are formatted in the browser's time zone; every other date on the tab uses the preference. The cause is the one in #2148, which #2149 fixed for the sequence due dates.
Both versions of Learning are affected: the frontend-build and frontend-platform version under src/, and the frontend-base version under frontend-base/ on the frontend-base branch, where #2252 (open) ports the two alerts with the same reads.
[!NOTE]
This issue was written by Claude (Claude Code) and reviewed before posting.
Claude Plan
Mechanism
Read from the code at the linked commits; not reproduced in a browser.
-
Both alerts' hooks read
userTimezoneas a top-level key of the outline data:useCourseEndAlertanduseCertificateStatusAlert. The outline data has no such key (normalizeCourseHomeOutline): the outline response carriesuser_timezoneonly insidedates_widget(outline/serializers.py,outline/views.py). So each hook putsundefinedin its alert's payload. -
Each alert builds its format arguments as
userTimezone ? { timeZone: userTimezone } : {}(CourseEndAlert.jsx,CertificateStatusAlert.jsx), so its dates are formatted in the browser's time zone. -
The reads were right until #606 (
70e2aa02, 2021), which moved the tab's time zone reads to the course metadata. In these two hooks it tookuserTimezoneout of thedatesWidgetnesting and left the read on the outline data, as it did in the read #2148 describes:const { datesWidget: { courseDateBlocks, - userTimezone, }, + userTimezone, } = useModel('outline', courseId); -
The certificate status alert has a second fault. It spreads the format arguments onto its
FormattedMessage, which has notimeZoneprop, and the twoFormattedDateelements inside the message get none (CertificateStatusAlert.jsx). With a time zone in its payload, the alert would still format both dates in the browser's time zone. The spread has been there since #477 added the alert, so its dates have never used the preference.
Timeline
| When | Change | Course end alert | Certificate status alert |
|---|---|---|---|
| 2020-08-03 | #146 (314b82d0) adds the course end alert; its hook reads datesWidget.userTimezone from the outline model |
working | not there yet |
| 2021-06-10 | #477 (fab2da45) adds the certificate status alert; its hook reads datesWidget.userTimezone too, and the component spreads the time zone onto its FormattedMessage |
working | hook right, dates never get the time zone |
| 2021-09-03 | #606 (70e2aa02) moves the tab's time zone reads to the course metadata; in these two hooks it takes userTimezone out of the datesWidget nesting and leaves the read on the outline model |
broken from here | hook broken too |
| 2026-09-22 | #2093 (218c9dfb), part of the Redux to React Query migration, swaps useModel('outline', courseId) for useOutlineTabData(courseId, { enabled: false }).data |
broken, same read | broken, same read |
The outline model had no top-level userTimezone after #606: the store snapshot at that commit carries it only under courseHomeMeta, and #606 removed user_timezone from the outline test factory.
Where it shows
- Course end alert, shown to an enrolled learner in the 14 days before the course ends (
hooks.js). In the last day it reads "This course is ending {timeRemaining} at {courseEndTime}.", a date, a time and a time zone abbreviation. Before that it reads "This course is ending {timeRemaining} on {courseEndDate}.", a date only. - Certificate status alert, in the "earned but not available" status: "This course ends on {courseEndDateFormatted}. Final grades and any earned certificates are scheduled to be available after {certificateAvailableDate}.", both dates only.
- A date with no time differs between the two time zones only when they put the instant on different days.
Elsewhere on the tab
The other dates on the tab read userTimezone from the course metadata, which carries it (course_metadata/views.py, api.ts): the dates widget (CourseDates.jsx), the sequence due dates since #2149 (SequenceDueDate.tsx), the course start alert (CourseStartAlert.jsx) and the access expiration alert (hooks.ts).
#2148 said, from the code and not observed, that the course end alert shows the preference's time zone. It does not.
Fix
useCourseEndAlertanduseCertificateStatusAlertreaduserTimezonefromuseCourseHomeMeta(courseId, { enabled: false }).data, asCourseDates.jsxdoes.CertificateStatusAlert.jsxspreads the format arguments onto its twoFormattedDateelements in place of theFormattedMessage.- Tests: the outline suite gains a case for each alert under a course metadata response whose
user_timezoneputs the alert's date on a different day than the browser's time zone does, asserting the date in the preference's time zone, as #2149's case does for a sequence due date.
Acceptance
- With
user_timezonein the course metadata response, the course end alert's date and time are formatted in that time zone - With
user_timezonein the course metadata response, the certificate status alert's two dates are formatted in that time zone - With no
user_timezone, both alerts format their dates in the browser's time zone, as today
- Dominant language
- JavaScript
- Stars
- 71
- Forks
- 341
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openedx/frontend-app-learning
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
openedx/frontend-app-learning#2265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openedx/frontend-app-learning#2250 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
openedx/frontend-app-learning#2147 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 94/100
openedx/frontend-app-learning#2119 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openedx/frontend-app-learning#2059 ·
Maintainers usually reply within 1 day
All issues in openedx/frontend-app-learning
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
check:passed logos:edit
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
inverse-inc/packetfence#9707 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
githubnext/gh-aw-workshop#5896 ·
Maintainers usually reply within 1 day