I want to disable all calendar months and days that are not valid, that are already past and I achieved it by adding the min and max property which helped me to limit my dates only to the range I am interested in, also use the [isDateEnable ] property to enable only the valid days of the month, but for some reason it disables me today, which is a current day.
app.page.ts Note: the isPast function is of date.fns library
enable_days = (dateIsoString:string) => {
const isPastDay = isPast(new Date(dateIsoString));// it returns me a true value if the day is not valid
return !isPastDay; // I tell him to enable me only those that came out false
}
// another way i tried
enable_days = (dateIsoString:string) => {
const day = new Date(dateIsoString);
const today = new Date();
if ( day >= today ) {
return true;
}
return false;
}
I don’t know why ionic takes today’s date as an invalid date, please can someone know why.
app.page.html enter image description here
calendar app evidence enter image description here
know why it is not taking today as a valid date
** the goal is to disable all invalid days of the month, for an appointment booking app, a user cannot book an appointment on a previous day