Commit 3284e0a6 authored by emododu's avatar emododu Committed by 杨奕

DatePicker: timezone

parent 3b3b3377
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
const WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; const WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
const clearHours = function(time) { const clearHours = function(time) {
const cloneDate = new Date(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(); return cloneDate.getTime();
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment