wa0x6e / cal-heatmap

Cal-Heatmap is a javascript charting library to create a time-series calendar heatmap
http://cal-heatmap.com
MIT License
2.71k stars 293 forks source link

Painted dataset is one interval behind #306

Closed wa0x6e closed 1 year ago

ChiaYuSu commented 1 year ago

I remember the previous version using moment.js, it seems that there is no such problem, to provide you with reference

ChiaYuSu commented 1 year ago

Hi, thank you for fixing this bug and releasing beta 7 as soon as possible! However, there are still some bugs in my environment, so please help me to check again

My console screen image

Import script

<!-- Heatmap -->
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/locale/zh-tw.js"></script>
<script src="https://unpkg.com/cal-heatmap@4.0.0-beta.7/dist/cal-heatmap.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/cal-heatmap@4.0.0-beta.7/dist/cal-heatmap.css"></script>
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/cal-heatmap@4.0.0-beta.7/dist/plugins/Tooltip.min.js"></script>
<script src="https://unpkg.com/cal-heatmap@4.0.0-beta.7/dist/plugins/Legend.min.js"></script>

Javascript

date: {
    timezone: 'Asia/Taipei',
    locale: 'zh-tw',
    start: '2023-01-01',
},

Painted dataset (I am set from 2023-01-01, but the dataset will start from 2022-12-01) image

wa0x6e commented 1 year ago

date.start expect a Javascript Date object, should be start: new Date('2023-01-01'),