Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Calendar Countdown

Track countdowns to important dates with daily Google Calendar events. Automatically calculates days remaining and updates your calendar each day.

Quick Setup

  1. Open Google Apps Script
  2. Create a new project
  3. Paste the countdown.js code
  4. Configure your countdowns in the CONFIG section
  5. Run createDailyCountdownEvent() once to test
  6. Run setupTriggers() to enable daily automation
  7. Done! Events will be created daily at 1 AM

How It Works

  • 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

Configuration

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
};

Configuration Options

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

Features

  • 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

Example Output

Your calendar will show events like:

  • Summer Vacation | 45 days left
  • Project Deadline | 21 days left
  • Birthday | Today! (on the final day)

Helper Functions

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 trigger

Troubleshooting

Events not being created?

  • Check that the calendar name matches exactly
  • Ensure enabled: true for your countdowns
  • Verify the end date hasn't passed

Getting errors?

  • Set enableLogging: true in CONFIG
  • Check the Executions log in Apps Script

License

MIT

About

Automated Google Apps Script that creates daily countdown events in your Google Calendar showing days remaining until important dates.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages