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

Handle minimumNights when changing startDate #1015

Merged
merged 1 commit into from Mar 9, 2018

Conversation

ggregoire
Copy link
Contributor

@ggregoire ggregoire commented Feb 9, 2018

Fixes #978

@coveralls
Copy link

coveralls commented Feb 9, 2018

Coverage Status

Coverage increased (+0.008%) to 86.521% when pulling bdc470d on ggregoire:fix-bug into 68c4ac6 on airbnb:master.

Copy link
Collaborator

@majapw majapw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but I'd appreciate if @sdjidjev took a look to make sure this doesn't cause any unexpected side-effects.

onFocusChange(END_DATE);

startDate = day;

if (isInclusivelyAfterDay(day, endDate)) {
if (!isInclusivelyAfterDay(lastAllowedStartDate, day) || isAfterDay(startDate, endDate)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bit cleaner if you wrote:

if (isBeforeDay(lastAllowedStartDate, day) || isAfterDay(startDate, endDate))

@sdjidjev
Copy link

sdjidjev commented Mar 8, 2018

i don't see any issues with this PR! i'll let @majapw do the final approval.

@majapw majapw merged commit 064b96c into react-dates:master Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants