Run a job on the last business day of the month
Finance wants the month-end export on the last business day. Not the 30th, not the 31st: the last weekday that isn’t a company holiday. Apps…
Run a job on the last business day of the month
Finance wants the month-end export on the last business day. Not the 30th, not the 31st: the last weekday that isn’t a company holiday. Apps…
List Holiday Dates
listHolidayDates(year, opts) reads a public holiday calendar with CalendarApp and returns sorted yyyy-MM-dd strings for that year, ready to…
Add Months Clamped
addMonthsClamped(date, n) adds or subtracts whole months and clamps to the last day of the target month instead of rolling into the next one…
Week Start Key
weekStartKey(date, tz) returns the Monday of that date's week as yyyy-MM-dd, computed in the given timezone. Use it as a stable grouping key…
Rows Older Than
rowsOlderThan(rows, dateField, days, opts) returns the row objects whose date field is older than N days, measured in calendar days in the…
Parse Loose Date
Imported sheets are full of dates that are really text: 03/04/2026, 4 Mar 2026, March 4th, 2026, 2026-03-04. parseLooseDate(value, {dayFirst…
Business Hours Between
Calendar hours lie about SLAs. A ticket opened Friday at 4pm and closed Monday at 10am looks like 66 hours and feels like two…
Add Business Days
“Due in three business days” is not date + 3. Weekends and company holidays get in the way. addBusinessDays(date, n, holidays) moves a date…
Is Last Business Day Of Month
Apps Script has no “last business day of the month” trigger. The reliable pattern is a daily time trigger plus a guard at the top of the job…
Filter Objects By Date Window
“Rows from the last 7 days” sounds trivial until a row stamped at 11:30pm in New York shows up as tomorrow because something compared…
Timezone-safe dates in Sheets and Apps Script
new Date() in Apps Script, a date cell in Sheets, and a teammate in another city will happily disagree by a day — and you'll spend an…