This commit is contained in:
mo.duan 2019-11-28 12:03:11 +08:00
parent 09279ce908
commit 3c8b2c0e11
2 changed files with 5 additions and 3 deletions

View file

@ -265,5 +265,5 @@
<script>
export default {
}
};
</script>

View file

@ -75,8 +75,10 @@
return this.calendar(tableYear, tableMonth, (cell) => {
// normalize date offset from the dates provided by jsCalendar
// Comment out this code to fix daylight saving time bug
if (cell.date instanceof Date) cell.date.setTime(clearHours(cell.date));
// Comment out this code to fix daylight saving time bug
// https://www.cnblogs.com/hamsterPP/p/5415472.html
if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000 + 480 * 60 * 1000);
//if (cell.date instanceof Date) cell.date.setTime(clearHours(cell.date));
const time = cell.date && clearHours(cell.date);
const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();