Skip to content

Commit af26afc

Browse files
committed
Minor simplification of timepicker.timezoneAdjust(). Left the addition of the negation of date.getTimezoneOffset() to make it clear that we need to reverse its sense. Just representing it as straight subtraction might be mathematically simpler and marginally more performant, but would fail to suggest this important detail.
1 parent b23be92 commit af26afc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@
19661966
$.timepicker.timezoneAdjust = function(date, toTimezone) {
19671967
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
19681968
if(!isNaN(toTz)){
1969-
date.setMinutes(date.getMinutes()*1 + (date.getTimezoneOffset()*-1 - toTz*1) );
1969+
date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
19701970
}
19711971
return date;
19721972
};

0 commit comments

Comments
 (0)