Replies: 2 comments 1 reply
-
Yeah, that’s a great call. I’m working on a refactored version for the
latest Nextjs version but you’re welcome to add it here with my most
sincere gratitude!
…On Sat, May 27, 2023 at 10:32 AM Trillium S ***@***.***> wrote:
Hey Tim,
I have a usecase where I need to make sure that appointments can't be
booked unless they're at least LEAD_TIME minutes in the future. I'd like to
add this to your project. As it stands now, I *believe* at 3:58pm a call
can be scheduled for 4:00pm.
I definitely want this timer to be able to be a different size from the
SLOT_PADDING variable.
Is that something you'd welcome being added to this project?
Proposal
Add a LEAD_TIME variable to config.ts so that appointments must be at
least LEAD_TIME minutes in the future.
—
Reply to this email directly, view it on GitHub
<#12>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYYSBTHNKBSD4VSGMX3LOTXII3B7ANCNFSM6AAAAAAYRJTXXU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I think I'm having a misunderstanding of how getAvailability works. Either that or I could use some help writing the right tests (I historically haven't written many tests). My initial thought was to add a busy window to the front of the array: export default function getAvailability({
potential: potentialParam,
busy,
padding = SLOT_PADDING,
leadTime = LEAD_TIME,
}:
...
const now = new Date()
const leadTimeBuffer = {
start: now, end: add(now, {minutes: leadTime})
}
//add leadTimeBuffer to front of busy array
busy?.unshift(leadTimeBuffer) I think that should work. If I'm understanding how the code is written right now (this is mostly for me, but if you see something in here that doesn't make sense let me know):
If that's correct, then adding another busy time to |
Beta Was this translation helpful? Give feedback.
-
Hey Tim,
I have a usecase where I need to make sure that appointments can't be booked unless they're at least LEAD_TIME minutes in the future. I'd like to add this to your project. As it stands now, I believe at 3:58pm a call can be scheduled for 4:00pm.
I definitely want this timer to be able to be a different size from the SLOT_PADDING variable.
Is that something you'd welcome being added to this project?
Proposal
Add a LEAD_TIME variable to
config.ts
so that appointments must be at least LEAD_TIME minutes in the future.Beta Was this translation helpful? Give feedback.
All reactions