Normalize dates offset

This commit is contained in:
SergioCrisostomo 2018-08-09 14:51:10 +02:00
parent 19b6c005b3
commit 46d1e7da9d

View file

@ -74,6 +74,9 @@
const disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate; const disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate;
return this.calendar(tableYear, tableMonth, (cell) => { 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 time = cell.date && clearHours(cell.date);
const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth(); const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();
return { return {