mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-03 04:39:09 +08:00
DatePicker: timezone
This commit is contained in:
parent
3b3b3377b5
commit
3284e0a662
@ -32,7 +32,9 @@
|
||||
const WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
|
||||
const clearHours = function(time) {
|
||||
const cloneDate = new Date(time);
|
||||
cloneDate.setHours(0, 0, 0, 0);
|
||||
const timeZoneOffset = cloneDate.getTimezoneOffset();
|
||||
const timeZone = timeZoneOffset >= 0 ? 24 - timeZoneOffset / 60 : timeZoneOffset / 60;
|
||||
cloneDate.setHours(timeZone, 0, 0, 0);
|
||||
return cloneDate.getTime();
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user