Last active
June 11, 2025 13:02
-
-
Save julik/d6c4a3a32a3145d5e7467baa4e1868e2 to your computer and use it in GitHub Desktop.
Revisions
-
julik revised this gist
Jun 11, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ var fromDate = new Date(2025, 4, 25) var evts = theCalendar.events.whose( {_and: [ {summary: { _beginsWith: eventNamePrefix }}, {startDate: { _greaterThan: fromDate}} ] } ); -
julik revised this gist
Jun 11, 2025 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,12 @@ const eventNamePrefix = "Amazing Project 123"; var theCalendar = Calendar.calendars.whose({name: calendarName})[0] var fromDate = new Date(2025, 4, 25) var evts = theCalendar.events.whose( {_and: [ {summary: { _beginsWith: eventNamePrefix }}, {startDate: { _greaterThan: fromDate}} ] } ); // Resolve the array let totalHours = 0; for (var evtHandleFn of evts()) { -
julik renamed this gist
Jun 10, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
julik created this gist
Jun 10, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ var Calendar = Application("Calendar") const calendarName = "My Calendar"; const eventNamePrefix = "Amazing Project 123"; var theCalendar = Calendar.calendars.whose({name: calendarName})[0] var fromDate = new Date(2025, 4, 25) var evts = theCalendar.events.whose( {_and: [ {summary: { _beginsWith: eventNamePrefix }}, {startDate: { _greaterThan: fromDate}} ]} ); // Resolve the array let totalHours = 0; for (var evtHandleFn of evts()) { let evtHandle = evtHandleFn(); let summary = evtHandle.summary(); let sd = evtHandle.startDate(); let ed = evtHandle.endDate(); let durationMillis = ed - sd; let durationHours = durationMillis / 1000 / 60 / 60; totalHours += durationHours; const [formattedDate] = sd.toISOString().split('T'); console.log(`${formattedDate}: ${summary} took ${durationHours.toFixed(2)} hours`); } console.log(`${totalHours.toFixed(2)} total hours`);