So, I have a cal-heatmap calendar working on my website. It displays data from December 2016 to November 2017.
On the same page, I have texts which are divided into different sections.
Here is the code for a section:
<h3 class="sectiontitle" id="week1" style="clear:both;">Week 1</h3>
<div class="divider"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
There is one section for every week in December 2016 to November 2017.
What I want is onClick on cal-heatmap's day, it will scroll to the corresponding section.
For example,
- onclick 3rd December 2016, it will link to week 1.
- onclick 4th December 2016, it will link to week 1.
- onclick 10th December 2016, it will link to week 2.
- onclick 28th December 2016, it will link to week 5.
According to cal-heatmap's documentation, I should use onClick(date, value) function. However, I don't know how to change the date given into the week number.
Please note that the date given is in this format: "Tue Jan 04 2000 17:00:00 GMT+0800 (China Standard Time)", not in timestamp format.
So, how can I achieve this? Thanks! I hope that I have explained it clearly.