In my VueJS application I'm using momentjs to validate if the user selected date is today or a future date.
Following is my custom validation rule.
const dateIsToday = (value) => {
let todayDate = moment();
let selectedDate = moment(value, "DD-MM-YYYY");
return moment(selectedDate).isSameOrAfter(todayDate);
};
This rule works with older dates.
But even when user selects a today's date, it gives an error.
Instead I should be able to allow to select today's date.