Fix jquery-dateFormat parseTime dropping the time in colon-labelled timezones - #7883
Open
ankurjuneja wants to merge 1 commit into
Open
Fix jquery-dateFormat parseTime dropping the time in colon-labelled timezones#7883ankurjuneja wants to merge 1 commit into
ankurjuneja wants to merge 1 commit into
Conversation
Open
2 tasks
labkey-jeckels
approved these changes
Jul 28, 2026
labkey-jeckels
left a comment
Contributor
There was a problem hiding this comment.
Request for a quick unit test for this change:
platform/core already has a jest harness (core/jest.config.js, jsdom, testRegex '(.(test)).(ts|tsx)$'), so a regression test is cheap: load jquery-dateFormat.js and assert that a Date stub whose toTimeString() returns 08:00:00 GMT-1000 (GMT-10:00) formats to 08:00, not 00:00.
| @@ -1,2 +1,2 @@ | |||
| /*! jquery-dateFormat 18-05-2015 */ | |||
Contributor
There was a problem hiding this comment.
Please add a note to both files to say they've been patched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
DateFormat.format.date(, …) builds its time from value.toTimeString() (e.g. "00:00:00 GMT-1000 (GMT-10:00)") and parseTime splits that whole string on :. It only accepts exactly 3 parts, so any timezone whose label contains a colon — Honolulu's (GMT-10:00), India's +05:30, etc. — yields 4+ parts, fails the check, and returns an empty time that pads to 00:00. Result: every Date formatted through this library shows midnight for affected users (calendar labels, tooltips, and anywhere DateFormat.format.date is used).
Fix: strip the trailing timezone label before splitting on : (time.replace(/\s.+/, '').split(':')) — the same strip the function already does at line 82, just applied before the length check instead of after. One-token change, applied to both jquery-dateFormat.js and jquery-dateFormat.min.js (the min file is served in production per jQuery.lib.xml, compileInProductionMode="false"). Non-affected timezones and the ISO/seconds parse paths are unchanged.
Related Pull Requests
Changes