Merge pull request #4250 from SergioCrisostomo/datepicker-patches

Normalize dates offset
This commit is contained in:
Aresn 2018-08-10 15:32:40 +08:00 committed by GitHub
commit 28a0f8b0b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,6 +74,9 @@
const disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate;
return this.calendar(tableYear, tableMonth, (cell) => {
// normalize date offset from the dates provided by jsCalendar
if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000);
const time = cell.date && clearHours(cell.date);
const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();
return {