Skip to content
This repository was archived by the owner on May 9, 2021. It is now read-only.

Commit 40139e6

Browse files
committed
Fix to am-pm detection logic
amNames contains entries in lowercase. Usually amNames[0] for i18n files. Using .toUpperCase in one side of the equality causes lowercase names to be evaluated as PM instead.
1 parent 3c9065e commit 40139e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery-ui-timepicker-addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@
810810
second !== parseInt(this.second,10) ||
811811
millisec !== parseInt(this.millisec,10) ||
812812
microsec !== parseInt(this.microsec,10) ||
813-
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
813+
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames.toUpperCase()) !== -1)) ||
814814
(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
815815
);
816816

0 commit comments

Comments
 (0)