components icon indicating copy to clipboard operation
components copied to clipboard

feat(DatePicker): select range of dates

Open alaawerfelli opened this issue 9 years ago • 148 comments

Hello, it's possible to set date range in date picker (have the ability to choose startDate and endDate and get all dates between startDate and endDate).

alaawerfelli avatar May 24 '17 08:05 alaawerfelli

Sometimes we need to provide the user with a month picker. Are you planning to support configuring the picker to have month as the lowest level?

By the way: I am so glad you are developing this date range picker now :)

perchristian avatar Mar 31 '20 08:03 perchristian

@mmalerba: shame there are no plans for side by side range... this dramatically improves UX... hopefully you will reconsider soon

demiro avatar Mar 31 '20 08:03 demiro

@perchristian this is really a UX discussion, but does a datepicker really make sense for selecting a month? selecting a day is pretty "complex" for the user, because different months have different number of days, maybe you are interested in seeing day of a week, plus we have leap years. We don't have any of that complexity when you just want to select a month. One could say that he/she wants to use date-picker for selecting a month to have consistency, but I would argue that simple dropdown with a month name, and an input/dropdown for a year - is easier to use.

margielm avatar Mar 31 '20 09:03 margielm

Filed https://github.com/angular/components/issues/18958 for the missing hover state.

The concept of date granularity/precision is something we've thought about a bit, but currently no concrete plans.

Unless side-by-side view gets explicitly added to the Material Design spec, I think what's more likely is that we'll focus on trying to make it easier for users to implement that and other custom UIs using the same building blocks we use for the default datepicker experience, but I don't really see us adding an API specifically for that.

mmalerba avatar Mar 31 '20 17:03 mmalerba

@mmalerba unless i am missing something Material Design spec does have side-by-side pickers:

https://material.io/components/pickers/#desktop-pickers

image

margielm avatar Mar 31 '20 19:03 margielm

@margielm oh, so it does (sorry I've been looking at unfinished internal stuff, I didn't even realize there's an official published spec now 😄)

I've created https://github.com/angular/components/issues/18966 to track this, it won't be in the first version of the range picker though

mmalerba avatar Apr 01 '20 17:04 mmalerba

The concept of date granularity/precision is something we've thought about a bit, but currently no concrete plans.

I would be glad to help with precision (month and year), please see https://github.com/angular/components/issues/4853#issuecomment-615162582.

tobiasschweizer avatar Apr 20 '20 06:04 tobiasschweizer

The feature is now in master and will be released in 10. Please post bugs as new issue reports. Closing and locking.

crisbeto avatar May 05 '20 15:05 crisbeto