vue3-calendar-heatmap
vue3-calendar-heatmap copied to clipboard
endDate bug only shows 1969 year
So basically even though i give the component the ":end-date" parameter it shows me the dates only between Dec 29, 1968 and Jan 3 1970.
<calendar-heatmap :end-date="2023-12-12" :values="[{ date: '1969-6-6', count: 6 }]" dark-mode/>
Is it possible this is a bug?
This happened because they have bad support for vue3, this happens for :values as well, there is two solution for this:
- :end-date="'2023-12-12'", string inside of variable
- create them as date, :end-date="new Date('2023-12-12')" ( I recommend this), I have found this answer after facing same problem.
Yes, i ended up finding a solution using
<script setup lang="ts">
const currentDate = new Date()
const endDate = currentDate.toISOString().split('T')[0]
</script>
<template>
<calendar-heatmap
class="calendar"
:end-date="endDate"
...
/>
</template>