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> <script>
export default { export default {
} };
</script> </script>

View file

@ -76,7 +76,9 @@
return this.calendar(tableYear, tableMonth, (cell) => { return this.calendar(tableYear, tableMonth, (cell) => {
// normalize date offset from the dates provided by jsCalendar // normalize date offset from the dates provided by jsCalendar
// Comment out this code to fix daylight saving time bug // Comment out this code to fix daylight saving time bug
if (cell.date instanceof Date) cell.date.setTime(clearHours(cell.date)); // 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 time = cell.date && clearHours(cell.date);
const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth(); const dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();