Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select next checkout date when it is disabled #69

Closed
hoangnguyen291 opened this issue Apr 19, 2018 · 3 comments
Closed

Cannot select next checkout date when it is disabled #69

hoangnguyen291 opened this issue Apr 19, 2018 · 3 comments
Assignees
Milestone

Comments

@hoangnguyen291
Copy link

hoangnguyen291 commented Apr 19, 2018

Description

ex: If tomorrow is booked by someone else, I can't select checkin date on today and checkout on tomorrow. In fact, tomorrow should be enabled if I selected checkin today.

Code sample

Steps to Reproduce

  1. Disable 2018-04-25
  2. Select checkin 2018-04-24
  3. 2018-04-25 should be enabled for checkout.

Datepicker Version

@hoangnguyen291
Copy link
Author

hoangnguyen291 commented Apr 21, 2018

Currently I have fixed this problem by modify Day.vue disableNextDays()

  disableNextDays(){
      if ( !this.isDateLessOrEquals(this.date, this.nextDisabledDate)
            && this.nextDisabledDate !== Infinity) {
              this.isDisabled = true;
      }
      else if ( this.isDateLessOrEquals(this.date, this.checkIn) ) {
        this.isDisabled = true;
      }
      if ( this.compareDay(this.date, this.checkIn) == 0 && this.options.minNights == 0) {
        this.isDisabled = false;
      }
      if (this.isDateLessOrEquals(this.checkIn, this.date) && this.options.enableCheckout ){
          this.isDisabled = false;
      }
      else {
          let enableDate = this.sortedDisabledDates.find(p => p > this.checkIn);
          let lastDisableDate = this.sortedDisabledDates.find(p => p < this.date && p > this.checkIn);
          if (this.compareDay(this.date, this.checkIn) == 1 && this.compareDay(this.date, enableDate)==0) {
              this.isDisabled = false;
          }
          if (lastDisableDate) {
              this.isDisabled = true;
          }
          return
      }
    },

@amulchinock
Copy link
Contributor

@hoangnguyen291 Are you suggesting that we allow checkin/checkout on the same date?

For example- your "hotel" has a check out at 10am on 01/01/1970, and another guest wishes to check in at 3pm on 01/01/1970.

At the moment, the datepicker doesn't specify date/times for the threshold of date cutoff. This means, if you block out a date as disabled (due to an existing booking), then there is no way for the user to check in on that date.

Feel free to make a pull request based on your code.

@krystalcampioni feature request? :)

@matiasperrone matiasperrone added this to the v3.0.0 milestone Jan 27, 2020
@matiasperrone matiasperrone self-assigned this Jan 27, 2020
matiasperrone pushed a commit that referenced this issue Aug 27, 2020
…create-half-day-dates

watch bookings for create halfDayDates
@matiasperrone
Copy link
Collaborator

Merged with #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants