Skip to main content

Countdown Module

The countdown module manages important date reminders.

Data Structure

interface CountdownItem {
id: string
name: string // Name
targetDate: string // Target date (YYYY-MM-DD)
repeatType: 'none' | 'monthly' | 'yearly' // Repeat type
repeatInterval: number // Repeat interval
createdAt: string
}

IPC Channels

ChannelParametersReturns
countdown-get-all-CountdownItem[]
countdown-createPartial<CountdownItem>CountdownItem
countdown-updateid, Partial<CountdownItem>CountdownItem
countdown-deleteidboolean

Date Calculation Logic

No Repeat

Directly calculates the difference between target date and today.

Monthly Repeat

Starting from the target date, increments by repeatInterval months to find the first date >= today.

Yearly Repeat

Starting from the target date, increments by repeatInterval years to find the first date >= today.

Sort Order

  1. Today (days === 0) first
  2. Future dates ascending by days
  3. Past dates last