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

Features/351 allow booking as of now #355

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

MelissaAutumn
Copy link
Member

@MelissaAutumn MelissaAutumn commented Apr 4, 2024

Fixes #351

Front-end change was easy, but then I realized you could book times in the past! I'm bad at math, so this is my attempt to fix that.

Basically we get the current seconds in a day (timezoned), and check if we're past today's start_time. If we are then adjust the range loop of our slot generation to be the next available slot.

So like...
Slot Duration = 30mins
Schedule Start = 9am
Now = 10:17am
then...
First bookable Slot = 10:30

image image

@MelissaAutumn MelissaAutumn requested a review from devmount April 4, 2024 21:32
@MelissaAutumn MelissaAutumn self-assigned this Apr 4, 2024
@MelissaAutumn MelissaAutumn added the l10n update A string has been added or needs updating label Apr 4, 2024
Copy link
Collaborator

@devmount devmount left a comment

Choose a reason for hiding this comment

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

Nice, works flawlessly on my end, even with adjacent busy slots 👏🏻

@MelissaAutumn MelissaAutumn merged commit e7628d1 into main Apr 8, 2024
2 checks passed
@MelissaAutumn MelissaAutumn deleted the features/351-allow-booking-as-of-now branch April 8, 2024 15:25
jdbass pushed a commit that referenced this pull request May 17, 2024
* Allow a user to make their schedule immediately bookable.

* If it's today and we're past our start_time then adjust the start_time to be the next bookable time slot for _today only_.

* 🌐 complete German translation

---------

Co-authored-by: Andreas Müller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n update A string has been added or needs updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "now" as an option for Bookable after dropdown in Booking Settings section
2 participants