This episode is for members only

Sign up to access "Build an Appointment Booking System With Livewire" right now.

Get started
Already a member? Sign in to continue
Playing
14. Excluding time already passed today

Episodes

0%
Your progress
  • Total: 3h 4m
  • Played: 0m
  • Remaining: 3h 4m
Join or sign in to track your progress

Transcript

00:00
If we look at the starting period for the period collection we've got, you'll notice something strange. This starts at 9 o'clock.
00:06
Now, at the moment, it is not 9 o'clock in the morning. So really what we want to do is exclude the period at the start of the day that has already passed. So we're going to go ahead and do that now.
00:18
Now, before we do that, let's go over to our web routes. And we're going to go and bring back our set test now. We're going to set this to today. But we're going to set the time from a time string.
00:29
I'm going to set this to 10 o'clock. So we really should only have availability after 10 o'clock. That's not going to be the case because we haven't set this up yet.
00:40
Okay, so we're going to go over to our schedule availability. And just after we have added our schedule exclusions, we're going to go ahead and call another method to exclude the time passed today.
00:50
So let's call this exclude time passed today. That kind of makes sense. And we don't necessarily need to pass anything through to this because we just want to take out a period
01:01
that has been from the start of the day up until now. Okay, let's go ahead and build in this method. So exclude time passed today. And let's see what we need to do here.
01:11
So again, we need to subtract a period. So let's go and take the periods and say this periods subtract. Into here, we'll go ahead and make out a period.
01:22
This needs to be now start of day. So the very start of the day. And then we just need to figure out what we want to subtract from this.
01:31
So what I typically do is say end of hour. So the end of the current hour is when our availability starts. So let's go and say precision
01:41
and we'll set this to minute of course. And let's take a look at the result and see if it's what we expected. Okay, so let's go into our periods here,
01:50
look at the start date and yeah, we are starting now at 11 o'clock. So if it's 10 o'clock, we go to the end of the hour and we can only book from 11.
01:59
Now you can adjust this and change this around if you want to. So for example, you could say add a half an hour and only allow appointments to be booked
02:08
after half an hour. But really within booking systems, you're not gonna find someone booking an appointment within the actual hour that they're booking.
36 episodes3 hrs 4 mins

Overview

Building an availability calendar and booking system is a notoriously difficult problem to solve. That’s exactly what we’re going to cover in this course.

Step by step, we’ll build an appointment slot generator that calculates availability based on employee schedules, employee’s booked time off, the length of service chosen, existing appointments, and cancelled appointments.

For maximum flexibility, we’ll also allow multi-employee availability checks, so we’ll be able to see every employee who can perform a service (and their available slots).

To finish up, we’ll create an entire booking flow with Livewire, including a beautiful booking calendar that shows detailed availability across multiple dates, the ability to choose a time slot — and finally the ability to book an appointment.

Phew. We’ve got a lot to learn — let’s build a booking system with Livewire!

Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Episode discussion

No comments, yet. Be the first!