Closed veloware closed 2 years ago
thanks for the heads up, will get on this over the weekend. if you need this to work ASAP, in the meantime you can alternatively use clearTime
:
import { useLilius, clearTime } from "use-lilius";
const {...} = useLilius({ selected: [ clearTime(new Date()) ]);
Describe the bug Setting a default selected day, does not ignore the time portion of the date, meaning
isSelected(day)
returns falseTo Reproduce
When setting the default selected date using -
then rendering out days as per the chakra example -
when it comes to the
isSelected(day)
for the box that represents 'today', it returns false, asday
has its time set to 0, however theselected
argument in theuseLilius({ selected: [ new Date() ]})
keeps the timestamp.console output for 'selected' from
Returns
-console output for
day
fromcalendar
mapHowever, manually stripping the time off before setting the initial selected date, seems to solve the issue -
Expected behavior Setting the default selected date using
new Date()
should ignore the time so it can accurately be compared with dates from thecalendar