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
It would be helpful for users to disable some dates within the min and max range so that the user cannot click or set these dates.
I am aware that the current standard of date input does not handle this, but for desktop users wich Clarity shows their date picker, it would be helpful.
We show users data that we only collected on certain days, and the user should be able to select those days without trying to see if the day is available (class: is-disabled). E.g. there is no data for 24 and 25.
Workarounds
Use something like patch-package to fix it for a particular application.
// https://github.com/vmware-clarity/ng-clarity/blob/v17.2.1/projects/angular/src/forms/datepicker/model/calendar-view.model.ts#L93
isDateExcluded(date) {
- const { minDate, maxDate } = this.excludedDates;+ const { minDate, maxDate, disabledDates, disabledDays } = this.excludedDates;
const from = minDate.toComparisonString();
const to = maxDate.toComparisonString();
const today = date.toComparisonString();
- return !(today >= from && today <= to);+ const excludedDatesExtra = (Array.isArray(disabledDates))? disabledDates: [];+ // TODO: excluded days e.g. if today is Mo or So+ const excludedDays = (Array.isArray(disabledDays))? disabledDays: [];+ const dateInFilters = excludedDatesExtra.find((fd =>{+ return fd.toComparisonString() === today;+ }));+ return !(today >= from && today <= to && !dateInFilters);
}
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Feature Request
Use case
It would be helpful for users to disable some dates within the
min
andmax
range so that the user cannot click or set these dates.I am aware that the current standard of date input does not handle this, but for desktop users wich Clarity shows their date picker, it would be helpful.
whatwg/html#9542
Examples
We show users data that we only collected on certain days, and the user should be able to select those days without trying to see if the day is available (class: is-disabled). E.g. there is no data for 24 and 25.
Workarounds
Use something like patch-package to fix it for a particular application.
Beta Was this translation helpful? Give feedback.
All reactions