mirror of https://github.com/ElemeFE/element
DatePicker: timezone
parent
3284e0a662
commit
6563a3a804
|
@ -33,7 +33,7 @@
|
|||
const clearHours = function(time) {
|
||||
const cloneDate = new Date(time);
|
||||
const timeZoneOffset = cloneDate.getTimezoneOffset();
|
||||
const timeZone = timeZoneOffset >= 0 ? 24 - timeZoneOffset / 60 : timeZoneOffset / 60;
|
||||
const timeZone = timeZoneOffset >= 0 ? 24 - timeZoneOffset / 60 : Math.abs(timeZoneOffset) / 60;
|
||||
cloneDate.setHours(timeZone, 0, 0, 0);
|
||||
return cloneDate.getTime();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue