Skip to content

Fix instrument scheduler datetime-local fields showing midnight on Firefox - #1266

Open
ankurjuneja wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_instrumentScheduleDateTimeLocalFirefox
Open

Fix instrument scheduler datetime-local fields showing midnight on Firefox#1266
ankurjuneja wants to merge 2 commits into
release26.7-SNAPSHOTfrom
26.7_fb_instrumentScheduleDateTimeLocalFirefox

Conversation

@ankurjuneja

@ankurjuneja ankurjuneja commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

  • scheduleUtils.js: add shared toDateTimeLocalValue
  • scheduler.js: populate the datetime-local inputs via ScheduleUtils.toDateTimeLocalValue
  • instrumentCalendar.jsp: replace open-coded zero-pad date formatting with ScheduleUtils.toDateValue
  • InstrumentSchedulingTest: assert the fields default to T08:00/T17:00 so a regression that zeroes or shifts the time fails on any agen

Tasks 📍

  • Claude Code Review
  • Manual Testing
  • Test Automation

maximumFractionDigits: 2
});

$('#setup-cost').val('$' + setupFee.toLocaleString('en-US', {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@labkey-jeckels labkey-jeckels added this to the 26.07 milestone Jul 28, 2026
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.

2 participants