haiilo/catalyst

Datepicker in range mode emits ambiguous values

Closed this issue · 1 comments

shaxqt commented

When the datepicker is set to range mode it emits a string containing one date only for every time you click on the first date. The problem is that it also only a single date when the same date was clicked twice, so can't determine if the emitted value was just the first click (and the end date is not selected yet) or if the user clicked the same date twice.

Expected behaviour imo would be to:

  1. Always emit 2 dates, even if the end-date and start-date are equal
  2. Do not emit any value when the user just selected the first/start date. Because he/she could still click away, which would close the datepicker and leave it blank.

Nice to have feature: In my opinion it would make sense if the time of the end-date is always set to end of the day. I guess in most use cases you would want to include the end-date in the time range from the datepicker. If not you could just ignore the time. But setting the time on the end-date, would reduce overhead on components using this datepicker.

So to summ it up, I would expect the component to only emit values like (when in range mode):
2017-03-04T00:00:00.000Z - 2017-03-04T23:59:59.999Z

closed with 087dcb8