-
Notifications
You must be signed in to change notification settings - Fork 942
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
Availability for the date range picker #891
Conversation
19addae
to
d613621
Compare
d613621
to
1263340
Compare
A changelog entry is coming in a PR that uses this feature in the template. |
|
||
const lastBlockedBetweenExclusive = (timeSlots, startDate, endDate) => { | ||
if (startDate.isSame(endDate, 'date')) { | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to null
const firstBlockedBetween = (timeSlots, startDate, endDate) => { | ||
const firstDate = moment(startDate).add(1, 'days'); | ||
if (firstDate.isSame(endDate, 'date')) { | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to null
const lastBlockedBetween = (timeSlots, startDate, endDate) => { | ||
const previousDate = moment(endDate).subtract(1, 'days'); | ||
if (previousDate.isSame(startDate, 'date')) { | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change undefined returns to nulls
Overview
Adds support for availability to
FieldDateRangeInput
. It is used by passing atimeSlots
prop that contains available dates.Features
Nightly booking
When using nightly booking, the end date can be selected between the start date and the following booked date, including the booked date.
Daily booking
When using daily booking, the end date can be selected between the start date and the following booked date, excluding the booked date.
Selecting end date first
When selecting end date first, the possible start dates are limited by the previous booked date from the end date.
Updating start date
After both dates are selected, updating the start date to a date before a booked date that is between the new and old start dates, the end date is cleared.