Track countdowns to important dates with daily Google Calendar events. Automatically calculates days remaining and updates your calendar each day.
- Open Google Apps Script
- Create a new project
- Paste the
countdown.jscode - Configure your countdowns in the
CONFIGsection - Run
createDailyCountdownEvent()once to test - Run
setupTriggers()to enable daily automation - Done! Events will be created daily at 1 AM
- Creates one all-day event per countdown each day
- Shows "Name | X days left" format
- Automatically stops when the end date is reached
- Customizable final day message (default: "Today!")
- Everything runs in your Google account
Edit the countdowns in the script:
CONFIG = {
calendarName: "Countdown",
countdowns: [
{ id: "vacation", name: "Summer Vacation", endDate: "2025-12-25", enabled: true },
{ id: "deadline", name: "Project Deadline", endDate: "2025-11-01", enabled: false },
{ id: "birthday", name: "Birthday", endDate: "2025-08-15", enabled: true },
],
showZeroDays: true, // Show "0 days left" on final day
finalDayMessage: "Today!", // Message shown on the final day
};| Option | Type | Description |
|---|---|---|
id |
string | Unique identifier for the countdown |
name |
string | Display name (shown in calendar) |
endDate |
string | End date in YYYY-MM-DD format |
enabled |
boolean | Whether to create events for this countdown |
showZeroDays |
boolean | Show event when 0 days left |
finalDayMessage |
string | Custom message for the final day |
- Multiple countdowns supported
- Smart event deduplication (won't create duplicates)
- Automatic daily updates via triggers
- Performance optimized with caching
- Past countdowns are automatically skipped
- No external dependencies
Your calendar will show events like:
Summer Vacation | 45 days leftProject Deadline | 21 days leftBirthday | Today!(on the final day)
You can run these functions directly from the Apps Script editor:
showCountdownStats() // Display statistics in console
getCountdownStats() // Get statistics as object
setCountdownEnabled("vacation", true) // Enable/disable a countdown
addCountdown({ id, name, endDate }) // Add a new countdown
removeCountdown("vacation") // Remove a countdown
setupTriggers() // Manually setup daily triggerEvents not being created?
- Check that the calendar name matches exactly
- Ensure
enabled: truefor your countdowns - Verify the end date hasn't passed
Getting errors?
- Set
enableLogging: truein CONFIG - Check the Executions log in Apps Script
MIT