Skip to content

Commit 9b8bfa9

Browse files
updates timezone conversions
1 parent 86d2691 commit 9b8bfa9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ <h3 id="rest_examples">Time Restraints</h3>
829829
var endDateTextBox = $('#rest_example_4_end');
830830

831831
startDateTextBox.datetimepicker({
832+
timeFormat: 'HH:mm z',
832833
onClose: function(dateText, inst) {
833834
if (endDateTextBox.val() != '') {
834835
var testStartDate = startDateTextBox.datetimepicker('getDate');
@@ -845,6 +846,7 @@ <h3 id="rest_examples">Time Restraints</h3>
845846
}
846847
});
847848
endDateTextBox.datetimepicker({
849+
timeFormat: 'HH:mm z',
848850
onClose: function(dateText, inst) {
849851
if (startDateTextBox.val() != '') {
850852
var testStartDate = startDateTextBox.datetimepicker('getDate');

jquery-ui-timepicker-addon.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,10 +1968,7 @@
19681968
$.timepicker.timezoneAdjust = function(date, toTimezone) {
19691969
var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
19701970
if(!isNaN(toTz)){
1971-
var currTz = date.getTimezoneOffset()*-1,
1972-
diff = currTz - toTz; // difference in minutes
1973-
1974-
date.setMinutes(date.getMinutes()+diff);
1971+
date.setMinutes(date.getMinutes()*1 + (date.getTimezoneOffset()*-1 - toTz*1) );
19751972
}
19761973
return date;
19771974
};

0 commit comments

Comments
 (0)