Skip to content

Commit db76575

Browse files
authored
fix(bounds): don't use start of day (#211)
1 parent f611673 commit db76575

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/calendar.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export const getEventsFromCalendar = async url => {
1414
/**
1515
* @param {Date} start
1616
*/
17-
export const getWeekBounds = (start = new Date()) => {
18-
start.setUTCHours(0, 0, 0, 0);
19-
17+
export const getNextWeek = (start = new Date()) => {
2018
const end = new Date(start);
2119
end.setUTCDate(start.getUTCDate() + 7);
2220

@@ -30,7 +28,7 @@ export const getWeekBounds = (start = new Date()) => {
3028
* @returns {Promise<Date|null>} The date of the next meeting, or null if no meeting is found
3129
*/
3230
export const findNextMeetingDate = async (allEvents, { properties }) => {
33-
const [weekStart, weekEnd] = getWeekBounds();
31+
const [weekStart, weekEnd] = getNextWeek();
3432

3533
const filteredEvents = allEvents.filter(
3634
event =>

0 commit comments

Comments
 (0)