From 46d1e7da9d78c99d65e697d890890070b7287f02 Mon Sep 17 00:00:00 2001 From: SergioCrisostomo Date: Thu, 9 Aug 2018 14:51:10 +0200 Subject: [PATCH] Normalize dates offset --- src/components/date-picker/base/date-table.vue | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue index 5f6e933..3260bcc 100644 --- a/src/components/date-picker/base/date-table.vue +++ b/src/components/date-picker/base/date-table.vue @@ -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 { -- libgit2 0.21.4