Logic to compare dates and return boolean value to calendar

I’m implementing a logic for a calendarpicker component, which has
disabledDateCallback event param, which provides date, but need to
apply some logic so that it can disable all dates returned from a
service, provided return statement should be boolean.

<CalendarPicker 
  disabledDateCallback={(date:Date)=>{
    dateService.holidays.map((d)=>{
    return date === d
  })
}}
/>

Problem is the component need boolean, but Im not sure how to compare
date and service dates n return boolean value

84 thoughts on “Logic to compare dates and return boolean value to calendar”

Leave a Comment