-
Notifications
You must be signed in to change notification settings - Fork 0
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
Render Availabilities as TimeSlots in Scheduler View from FreeBusy API #71
base: feature-be-google-calendar-freebusy-api
Are you sure you want to change the base?
Render Availabilities as TimeSlots in Scheduler View from FreeBusy API #71
Conversation
…endering timeslots upon change in date * mapped the returned array to render in the timeslot selection area of the scheduler or returns "not available message" if there is no availability * request query params takes in day, month, year, duration, and user for freebusy query to work correctly
…ight larger than 300px
const [selectedDay, setSelectedDay] = useState(null); | ||
const [selectedDay, setSelectedDay] = useState({ | ||
day: tomorrowsDate.getDate(), | ||
month: tomorrowsDate.getMonth() + 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come this needs to be + 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's due to indices, maybes make a note of this in a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, regular JavaScript indexes the months starting with 0 whereas this library indexes it with 0, so December in the .getMonth()
method returns 11, but to display it as December for this library, it should be 12 which is where the ...+ 1
adjusts it to.
// request.query.meetingTypeID | ||
// request.query.date // must be in datetime format | ||
availabilitiesRouter.get("/freebusy", async (request, response) => { | ||
const { day, month, year } = request.query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { day, month, year } = request.query; | |
const { day, month, year, duration, user } = request.query; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this has to be
const { day, month, year } = request.query; | |
let{ day, month, year, duration, user } = request.query; |
in order to reassignment of
duration = Number(duration)
user = await User.findbyId(user)
in the suggestions below:
// request.query.date // must be in datetime format | ||
availabilitiesRouter.get("/freebusy", async (request, response) => { | ||
const { day, month, year } = request.query; | ||
const duration = Number(request.query.duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const duration = Number(request.query.duration); | |
const duration = Number(duration); |
availabilitiesRouter.get("/freebusy", async (request, response) => { | ||
const { day, month, year } = request.query; | ||
const duration = Number(request.query.duration); | ||
const user = await User.findById(request.query.user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const user = await User.findById(request.query.user); | |
const user = await User.findById(user); |
What it Does:
When there is Availability:
When There Isn't:
What to Look For:
What To Avoid