Calendar flexibility in selecting specialDates/disabledDates #12105
Replies: 7 comments
-
So are you suggesting we introduce new enumeration for all the cases you've listed? In total that would be 6 new entries. Another approach would be to introduce a second parameter to the WEEKENDS and WEEKDAYS members to specify the constraint. |
Beta Was this translation helpful? Give feedback.
-
That's what I though too. The second constraint can be passed even now and is ignored, if type is this.calendar.disabledDates = [
{ type: DateRangeType.Weekends, dateRange: range },
];
this.calendar.specialDates= [
{ type: DateRangeType.Weekdays, dateRange: range },
]; and no changes in the API are needed, just implementation changes. |
Beta Was this translation helpful? Give feedback.
-
Extending the enum would be cleaner in terms of usage in the component after. Second parameter would mean passing another DateRangeDescriptor inside, but then using only BEFORE, AFTER and BETWEEN from it. We can't disallow passing the rest. You will have then cases inside the WEEKEND and WEEKDAY cases, which will bloat the code IMO. |
Beta Was this translation helpful? Give feedback.
-
That would mean to add two new enums to the already available, to serve for the last cases suggested - weekends/weekdays AFTER/BEFORE a date, right? |
Beta Was this translation helpful? Give feedback.
-
There has been no recent activity and this issue has been marked inactive. |
Beta Was this translation helpful? Give feedback.
-
@hanastasov This never reached development, or did we not associate it with the issue? |
Beta Was this translation helpful? Give feedback.
-
Never reached development, that's why there is also no PR associated. |
Beta Was this translation helpful? Give feedback.
-
Question
The
DateRangeDescriptor
class provides means to configure dates selection in following ways:Why not being able to specify the following as well:
The above seems to require no API changes and only implementation changes to respect the range provided:
Those two seem to require API changes, maybe passing a second type constraint:
but seems to bring complexity that is not worth to handle I think.
Beta Was this translation helpful? Give feedback.
All reactions