Problem: Currently, the isInvalidDate method is disabling the incorrect day, usually the day after the one configured. This happens due to the presence of time information in the dates, which affects the comparison, along with potential timezone issues.
Solution:
Implicit Time Fix: To avoid date comparison issues with different times, use the .startOf('day') method when comparing the dates in the momentDatesArray and the date being checked. This ensures that the comparison is done only at the day level, ignoring hours, minutes, and seconds.
Timezone Adjustment: If the dates in the array or the ones being compared are in different time zones, it can cause the wrong days to be disabled. The solution is to ensure all dates are in the same timezone by using .utc() to align the comparison.
Conclusion: These changes ensure that the isInvalidDate method works correctly, comparing only the day and disabling the correct date, regardless of time or timezone.
Problem: Currently, the isInvalidDate method is disabling the incorrect day, usually the day after the one configured. This happens due to the presence of time information in the dates, which affects the comparison, along with potential timezone issues.
Solution:
Implicit Time Fix: To avoid date comparison issues with different times, use the .startOf('day') method when comparing the dates in the momentDatesArray and the date being checked. This ensures that the comparison is done only at the day level, ignoring hours, minutes, and seconds.
Correction example:
Timezone Adjustment: If the dates in the array or the ones being compared are in different time zones, it can cause the wrong days to be disabled. The solution is to ensure all dates are in the same timezone by using .utc() to align the comparison.
Timezone correction example:
Conclusion: These changes ensure that the isInvalidDate method works correctly, comparing only the day and disabling the correct date, regardless of time or timezone.