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
Notice that the calendar start selection state resets, which is undesirable - people might just want an error indicator and fix the date themselves
Proposed fix (tested locally),
Allow the option the inject a custom dateInputValid checker, so the date input turns red in the above cases.
Example,
RangeCalendar,
/*
Closure magic used for injecting a validation rule for the dateinput when,
- start time is higher than end time
- end time is lower than start time
The alternative involves spaghetti code and multiple points of state mutation.
*/
<CalendarPart
...
dateInputValid={((endValue) => ((startDate) => startDate.isBefore(endValue)))(selectedValue[1])}
/>
<CalendarPart
...
dateInputValid={((startValue) => ((endDate) => endDate.isAfter(startValue)))(selectedValue[0])}
/>
Issue happens in these cases,
STR:
Proposed fix (tested locally),
Allow the option the inject a custom
dateInputValid
checker, so the date input turns red in the above cases.Example,
RangeCalendar,
CalendarPart,
DateInput,
The text was updated successfully, but these errors were encountered: