bendavis78 / paper-date-picker

Material design date picker component for polymer
http://bendavis78.github.io/paper-date-picker/
MIT License
226 stars 132 forks source link

Feature request: select date range #124

Open NicolasRannou opened 8 years ago

NicolasRannou commented 8 years ago

Often times you want to select a starting date and a finishing date (hotel, trip).

It would be great to be able to do it with this element, maybe adding a "range" or "multi" or whatever flag

NicolasRannou commented 8 years ago

Awesome element btw :)

dgabrielli76 commented 8 years ago

I am not sure but I think what you want is able by using min-date and max-date am I right?

NicolasRannou commented 8 years ago

Hmm no, min/max-date doesn't allow the user to pick 2 dates, it just allows the user to pick 1 date within a range, right?

I want to get 2 dates out of the date-picker element, and highlight the dates in between if possible.

dgabrielli76 commented 8 years ago

Oh sorry I did not understand what you mean... Effectively I do not think the feature you mentioned exist any more, what I mentioned was to pick only one date within a range like you say, another time sorry for my mistake ;)

bendavis78 commented 8 years ago

The MD spec doesn't cover the UX for this, and this component is intended to be (within reason) a reference implementation. So, I'm hesitant to change the component much to add this functionality when it can be done more simply with two date fields. I would, however, be interested in seeing mock-up ideas for how this might work while not straying too far from the spec.

If it makes sense to pull paper-calendar out into a separate component that would allow for more customization, I'd be more apt to do that, and add some more fine-grained features to paper-calendar, such as tracking an array of disabled / allowable dates (see #113), and a "range" mode.

NicolasRannou commented 8 years ago

Thanks that makes sense. I actually used 2 date pickers (one for start and one for end data), which is more than enough.

I think that a feature such as the one described in #113 would be a perfect alternative (Angular team included it in theirs Date Picker implementation ([1]).

[1] - https://material.angularjs.org/latest/demo/datepicker

kumarvishal commented 7 years ago

Anyone implemented date range using this datepicker ? Yes, date range would be great addition to this plugin as it is a frequently used feature.

web-padawan commented 7 years ago

Not yet. There is edk-date-picker, which has this feature, but it is outdated.

jonadeline commented 7 years ago

Here is a just released range date picker inspired by Airbnb one : https://github.com/RoXuS/range-datepicker