timfee / meet Goto Github PK
View Code? Open in Web Editor NEWA lightweight Calendly-esque appointment booker, using Next 13
License: MIT License
A lightweight Calendly-esque appointment booker, using Next 13
License: MIT License
When increasing DEFAULT_WORKDAY hours from 17 to 23, potential appointment slots in future days sort out of order in regard to Los Angeles timezone (hasn't been tested with other timezones at time of writing).
const DEFAULT_WORKDAY = [
{
start: {
hour: 9,
},
end: {
hour: 23, // <-- Changed 17 to 23
},
},
]
Today availability ends at 5pm PST even if availability extends beyond 5pm. This is likely because PST is -7 UTC, so when the application is creating dates, the remaining slots are being shunted to the following day.
This issue ties in with #14 , it's probably the same bug.
const DEFAULT_WORKDAY = [
{
start: {
hour: 9,
},
end: {
hour: 23, // <-- Changed 17 to 23
},
},
]
This is so good self-scheduling project! Thanks for sharing ๐
Is it possible to extend this so that it can handle a few different users/calendars? Maybe a dropdown like Timezone but with all users added and when you select a user the calendar is based on that users availability? Do you know if this is difficult to integrate and solve?
Hi, I've noticed if changing the owner timezone to another country i.e. something like Australia, (in config.ts -> OWNER_TIMEZONE), I get an error:
error lib\availability\helpers.ts (68:20) @ toLocaleTimeString
error Error [RangeError]: Value longGeneric out of range for Date.prototype.toLocaleTimeString options property timeZoneName
at Date.toLocaleTimeString ()
I've noticed this problem goes away by removing the timezonename: "longGeneric" clause in request.ts interval to human string fx ->
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return ${formatLocalDate(start, { month: "long", day: "numeric", hour: "numeric", minute: "numeric", weekday: "long", timeZone, })} โ ${formatLocalTime(end, { hour: "numeric", minute: "numeric", timeZone, timeZoneName: "longGeneric", })}
}
'''
when removing timezonename: "longGeneric" i no longer have this problem i.e.
'''
function intervalToHumanString({
start,
end,
timeZone,
}: DateTimeIntervalWithTimezone): string {
return `${formatLocalDate(start, {
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
weekday: "long",
timeZone,
})} โ ${formatLocalTime(end, {
hour: "numeric",
minute: "numeric",
timeZone,
})}`
}
'''
Love the project! I had a similar urge to make a simple white-labeled scheduler. Happy this is already out there!
One small improvement from a UX perspective is that the browser has timezone available via Intl.DateTimeFormat().resolvedOptions().timeZone
.
Wrapping a setter in a UseEffect, e.g.:
import { useEffect } from 'react';
import { useProvider } from "@/context/AvailabilityContext"
import getTimezoneData from "@/lib/timezones"
const { groupLookupMap, timeZoneMap } = getTimezoneData()
export default function TimezonePicker() {
const {
state: { timeZone },
dispatch,
} = useProvider()
useEffect(() => {
// Set the timezone from the browser when the component mounts
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
dispatch({
type: "SET_TIMEZONE",
payload: browserTimezone,
});
}, [dispatch]);
// ... rest of TimezonePicker.ts
... automatically selects the user's browser's timezone without them having to go fish for it.
Thank you for this and kudos!
Loading the base website /
should direct the user to the first available day of appointments, eg Friday
During certain time windows the application loads /
and directs the user to the following day, eg Saturday
This is likely because the useEffect hook isn't consdering timezone when offering suggestions of date.
// index.ts
useEffect(() => {
if (!selectedDate && slots.length > 0) {
dispatch({
type: "SET_SELECTED_DATE",
payload: Day.dayFromDate(slots[0].start), // <-- Doesn't take into account frontend timezone
})
}
}, [])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.