fix(Calendar): fix timezone

This commit is contained in:
nemo-shen 2021-12-14 00:35:26 +08:00 committed by neverland
parent 3b120e3c5b
commit 33a32903e0
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ function getMonths(minDate, maxDate) {
var cursor = getDate(minDate); var cursor = getDate(minDate);
cursor.setDate(1); cursor.setDate(1);
cursor.setMinutes(cursor.getMinutes() - cursor.getTimezoneOffset()) cursor.setMinutes(cursor.getMinutes() - cursor.getTimezoneOffset());
do { do {
months.push(cursor.getTime()); months.push(cursor.getTime());

View File

@ -497,7 +497,7 @@ exports[`should render demo and match snapshot 1`] = `
> >
<month <month
class="month" class="month"
data-date="{{1325347200000}}" data-date="{{1325376000000}}"
id="month0" id="month0"
bind:click="onClickDay" bind:click="onClickDay"
> >
@ -892,7 +892,7 @@ exports[`should render demo and match snapshot 1`] = `
</month> </month>
<month <month
class="month" class="month"
data-date="{{1328025600000}}" data-date="{{1328054400000}}"
id="month1" id="month1"
bind:click="onClickDay" bind:click="onClickDay"
> >
@ -1270,7 +1270,7 @@ exports[`should render demo and match snapshot 1`] = `
</month> </month>
<month <month
class="month" class="month"
data-date="{{1330531200000}}" data-date="{{1330560000000}}"
id="month2" id="month2"
bind:click="onClickDay" bind:click="onClickDay"
> >