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

Use dayCountAvailableForBooking config in FieldDateAndTimeInput #129

Merged
merged 2 commits into from
Jan 5, 2021

Conversation

OtterleyW
Copy link
Contributor

Use dayCountAvailableForBooking config instead of hard-coded value in FieldDateAndTimeInput so that it matches the date range that is used in react-dates components.

Earlier the dayCountAvailableForBooking was set to 90 but the MAX_TIME_SLOTS_RANGE was 180 and the calendar looked broken because after the first 3 months the timeslots appeared as blocked. Also, if you selected the date far enough in the future, checking the timeslots broke and all the dates seem to be available.

field-date-and-time-old

If the dayCountAvailableForBooking and MAX_TIME_SLOTS_RANGE is the same, showing the timeslots works correctly. Here's both 90 and 180 days options:
field-date-and-time-new-90
field-date-and-time-new-180

And since there's the limitation that by default Stripe is holding funds up to 90 days from the moment they are charged, I think keeping the default range in 90 would be the best solution.

// A maximum number of days forwards during which a booking can be made.
// This is limited due to Stripe holding funds up to 90 days from the
// moment they are charged. Also note that available time slots can only
// be fetched for 180 days in the future.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you also update the comment here (and in config.js) about time-slot query:
https://www.sharetribe.com/api-reference/marketplace.html#query-time-slots

It seems that the 180 day limit has been pushed forward.

Copy link
Collaborator

@Gnito Gnito left a comment

Choose a reason for hiding this comment

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

Looks good, but I think it would be good to update the code comments at this point (they are not in sync with API).
So, maybe adding a link to API Reference and Stripe would make sense:
https://stripe.com/docs/connect/account-balances#holding-funds

@OtterleyW OtterleyW merged commit d770f91 into master Jan 5, 2021
@OtterleyW OtterleyW deleted the align-max-timeslots-range branch January 5, 2021 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants