t1m0n / air-datepicker

Lightweight, dependency-free JavaScript datepicker.
https://air-datepicker.com
MIT License
2.58k stars 1.36k forks source link

Ability to select date range on same day #563

Closed fulit103 closed 10 months ago

fulit103 commented 10 months ago

Currently, I cannot select the end date range on the same day, a few hours later than the start date - it's minimum 1 day in-between.

I saw this thread related, apparently is solved but i cannot select the end date range on the same day

https://github.com/t1m0n/air-datepicker/issues/74

I created this wrapper for ember https://github.com/fulit103/ember-air-datepicker, Currently I'm using this library on Jebbit.com platform, could you suggest me a solution?

fulit103 commented 10 months ago

My bad, I used toggleSelected parameter:

toggleSelected: ({ datepicker }) => {
        if (self.args.range == true) {
          if (datepicker.selectedDates.length == 2) {
            return true;
          }
          return false;
        }
        return true;
}

https://github.com/fulit103/ember-air-datepicker/pull/6/files

thanks