Commit 46d1e7da9d78c99d65e697d890890070b7287f02

Authored by SergioCrisostomo
1 parent 19b6c005

Normalize dates offset

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
src/components/date-picker/base/date-table.vue
@@ -74,6 +74,9 @@ @@ -74,6 +74,9 @@
74 const disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate; 74 const disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate;
75 75
76 return this.calendar(tableYear, tableMonth, (cell) => { 76 return this.calendar(tableYear, tableMonth, (cell) => {
  77 + // normalize date offset from the dates provided by jsCalendar
  78 + if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000);
  79 +
77 const time = cell.date && clearHours(cell.date); 80 const time = cell.date && clearHours(cell.date);
78 const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth(); 81 const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();
79 return { 82 return {