material icon indicating copy to clipboard operation
material copied to clipboard

md-datepicker should allow more fine-grained control over pickable dates

Open scspijker opened this issue 11 years ago • 5 comments

Right now md-datepicker allows for a maximum and a minimum date to pick. This is a nice start, but more fine-grained control is required. For my own problem I'd need to be able to disable weekends, however, this is awfully specific. I suggest a callback which requests whether a date should be pickable. This might not be optimal in performance (30 requests for each month, or 1 if the callback supplies a list of dates), but is easy to implement for the angular team. Optimisations could be dealt with in a later release.

scspijker avatar Sep 10 '15 11:09 scspijker

Another nice granularity would be selecting what day is the start of the week. Currently Sunday is the only starting day.

In the app I am currently working it would be beneficial if the Datepicker started the week with Monday.

TylersDesk avatar Sep 16 '15 02:09 TylersDesk

@TylersDesk this was already implemented. Please see https://github.com/angular/material/issues/4316

scspijker avatar Sep 16 '15 05:09 scspijker

+1 for being able to give a list of dates that would be disabled from selection.

jsmylnycky avatar Oct 21 '15 14:10 jsmylnycky

+1 for this feature. I don't mind to implement this as it is a blocker for me. What would be better: invocation of callback function for each date or passing a list of pick-able dates? or both?

FDIM avatar Oct 29 '15 22:10 FDIM

A predicate function would be the most flexible approach.

jelbourn avatar Oct 29 '15 23:10 jelbourn