Commit 28a0f8b0b7d560aba7cfc49d068aef72a75967bb
Committed by
GitHub

Merge pull request #4250 from SergioCrisostomo/datepicker-patches
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 { |