11 posts tagged with “dates”

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…