Fix instrument scheduler datetime-local fields showing midnight on Firefox - #1266
Fix instrument scheduler datetime-local fields showing midnight on Firefox#1266ankurjuneja wants to merge 2 commits into
Conversation
| maximumFractionDigits: 2 | ||
| }); | ||
|
|
||
| $('#setup-cost').val('$' + setupFee.toLocaleString('en-US', { |
There was a problem hiding this comment.
Issue: Pre-existing, but in the function this diff modifies: #setup-cost, #instrument-fee, #total-cost, and #schedule-cost-error do not exist in scheduleInstrument.html (nor anywhere in the module — only #preview-* and #schedule-save-error do). So the four .val() calls in the success handler are no-ops, and the inner selectRows failure handler writes to nothing — a rate-type lookup failure produces no user-visible message at all.
Why it matters: The change's stated goal is that the cost log never shows garbage. It now bails silently on bad input and still fails silently on a query error, so a user who sees no cost row has no way to tell which happened.
Suggestion: Route the failure text to #schedule-save-error (which exists) and delete the three dead .val() calls. While in there, Math.abs() on line 602 is now redundant — the new guard already establishes end > start.
| assertProjectEventCounts(2, 0); | ||
|
|
||
| // The event chip time range is rendered via DateFormat (the patched parseTime path); verify it shows the real 8AM-5PM range, not a zeroed 00:00 - 00:00 as happened in colon-labelled timezones. | ||
| assertEquals("Event chip should show the 8AM-5PM time range", "08:00 - 17:00", getText(Locator.css(".activeProjectEvent .event-date"))); |
There was a problem hiding this comment.
Claude is concerned that this would fail if the server and browser are using different time zones. That's the Honolulu TZ config, so if that's passing, we should be fine.
Rationale
The instrument reservation modal's start/end datetime-local fields were rendered with DateFormat.format.date(date, container.dateTimeFormat), a display format with a space separator. Firefox strictly requires the W3C wire format yyyy-MM-ddTHH:mm and blanks any other value, so both fields collapsed to midnight and the save was rejected with "StartTime must be before EndTime" — reproducible on Firefox in timezones like Honolulu.
Related Pull Requests
Changes
Tasks 📍
Manual Testing