You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onSelect() hook passes a date object as an argument to its callback function, so you can use any method of the date object.
To compare 2 dates you need to convert them into numbers, you can use the valueOf() method for this.
ex:
datepicker.onSelect((date)=>{
const newDate = new Date()
if(date.valueOf() < newDate.valueOf()) console.log("The date is in the past!")
})
Hi @mikecoj
I hope you can help me .. I have tried to compare the date selected in MCDatepicker using the onSelect() event hook and todays date using jQuery, but so far unsuccessfully .. how can I do this? .. I have also made a post on StackOverflow without any response here : https://stackoverflow.com/questions/69653851/how-can-i-check-if-selected-date-in-mcdatepicker-is-today%c2%b4s-date
Hope you can help me :-)
Best Regards
Stig
The text was updated successfully, but these errors were encountered: