Skip to content
Proyek

Tentang

Off Day is a holiday alarm clock app on iOS. Users can easily and elegantly mark holidays and toggle alarms based on conditions using the built-in shortcuts in Off Day.

Pengembangan web dan aplikasi

Cara angka ini diukur

Yang dapat Anda lakukan

  • Multi-layer day decision engine with deterministic priority: User Mark > Public Holiday Template > Base Calendar
  • Built-in public holiday templates: China Mainland, Xinjiang, Tibet, Guangxi, Ningxia, Hong Kong, Macau (Public / Force / Civil Servant), Singapore, Thailand, Korea, Japan, United States
  • Custom public holiday plans: create, edit, duplicate, import JSON, export JSON
  • Subscription-based remote templates: subscribe via URL, background refresh, update review with diff comparison, accept/reject/pause

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
0
dalam 15 hari
0
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

English | 中文

Off Day logo

Off Day

No alarms on off days.

A holiday-aware iOS app for day classification, automation, and reminders.

Swift 5.0 iOS 16+ App Store MIT License

Overview

Off Day helps users decide whether a day should be treated as an off day or a work day, then use that result in iOS Shortcuts and notification workflows.

The app is local-first:

  • Holiday data is bundled as JSON templates or user-imported custom plans.
  • User overrides, comments, and settings are stored in a local SQLite database.
  • Optional iCloud backup is available for database snapshots.

Key Features

  • Multi-layer day decision engine with deterministic priority: User Mark > Public Holiday Template > Base Calendar
  • Built-in public holiday templates: China Mainland, Xinjiang, Tibet, Guangxi, Ningxia, Hong Kong, Macau (Public / Force / Civil Servant), Singapore, Thailand, Korea, Japan, United States
  • Custom public holiday plans: create, edit, duplicate, import JSON, export JSON
  • Subscription-based remote templates: subscribe via URL, background refresh, update review with diff comparison, accept/reject/pause
  • Flexible base calendar modes: Standard weekly, Week-cycle, Day-cycle
  • Rich App Intents for Shortcuts automation: check day type, check clash day, get day details, find next off/work day, update day mark, manage day comments
  • Notification center for three scenarios: template expiration, upcoming public holidays, upcoming custom-mark days
  • Lock Screen widget: side-by-side off/work status and holiday names for today and tomorrow, plus compact circular widgets for either day
  • Backup and restore: iCloud auto backup, manual database export/import (.zip / .sqlite)
  • Localization support: English, Simplified Chinese, Traditional Chinese, Traditional Chinese (Hong Kong)
  • Optional alternative calendar display: Chinese lunar / Kyureki data support

How Off Day Decides a Day Type

Off Day merges three data sources in fixed order:

  1. User mark (manual override)
  2. Public holiday template entry (including holiday shifts)
  3. Base calendar configuration

Equivalent logic:

finalDayType = userMark ?? publicHolidayType ?? baseCalendarType

This rule is implemented in Off Day/DayManager.swift.

Built-in Holiday Template Coverage

Template files are located at Off Day/PublicPlan/JSON/.

Region Coverage
China Mainland / Xinjiang / Tibet / Guangxi / Ningxia 2024-01-01 to 2027-12-31
Liangshan, Sichuan 2026-01-01 to 2027-12-31
Hong Kong 2024-01-01 to 2027-12-31
Macau (Public / Force / Civil Servant) 2024-01-01 to 2027-12-31
Singapore 2024-01-01 to 2027-12-31
Thailand (Financial Institutions) 2024-01-01 to 2027-12-31
Korea 2024-01-01 to 2027-12-31
United States (Federal) 2024-01-01 to 2027-12-31
Japan 1955-01-01 to 2027-12-31

The 2027 China Mainland schedule follows the State Council notice published by Xinhua. For 2027, the Xinjiang, Tibet, Guangxi, Ningxia, and Liangshan templates temporarily use the mainland schedule pending local holiday updates. Historical local schedules are preserved.

Other 2027 schedules follow the official publications from Hong Kong, Macau, Singapore's Ministry of Manpower, the Bank of Thailand, Korea AeroSpace Administration, the U.S. Office of Personnel Management, and Japan's Cabinet Office. The Macau Civil Servant template marks full-day holidays only. The U.S. template includes the observance of New Year's Day 2028 on December 31, 2027.

Templates record the dates explicitly designated as holidays, substitute holidays, or make-up workdays. Adjacent ordinary weekends are handled by the base calendar. Local holidays in the Tibet template follow Lhasa notices; other cities and counties may differ. Thailand follows the nationwide financial institution calendar and excludes regional holidays such as Bangkok-only closures. The U.S. template covers Federal employees, including officially announced government-wide days off; private employers may follow different schedules.

Historical corrections verified on November 5, 2026:

Quick Start (User)

  1. Select a public holiday template.
  2. Configure your base calendar mode.
  3. Add Off Day intents in Shortcuts.
  4. Build personal automations (alarm, focus mode, reminders).
  5. Optionally add manual day marks and comments for exceptions.

Development

The Lock Screen widget uses the Widgets extension and the WidgetShared models. Enable the group.com.zizicici.zzz App Group in the signing profiles for both the app and the extension. For a different developer account, replace the group in both entitlements files and WidgetCalendarStore.appGroup with a group registered to your account.

Open the app once to sync the calendar, then long-press the Lock Screen, choose Customize → Lock Screen → Add Widgets, and select Off Day's Today & Tomorrow widget or the compact Today and Tomorrow circular widgets. The rectangular widget shows each holiday's name, falling back to the weekday when no holiday name is available. All three follow the app's day classification rules and advance at local midnight. Calendar edits request a timeline reload; WidgetKit controls when that reload occurs.

Requirements

  • macOS with Xcode 14 or newer
  • iOS/iPadOS 16.0+
  • Swift Package Manager (resolved automatically by Xcode)

Run

git clone https://github.com/zizicici/Off-Day.git
cd Off-Day
open "Off Day.xcodeproj"

Select the Off Day scheme and run on simulator or device.

Dependencies

Project Structure

Off Day/
├── Block/           # Main calendar UI and day interaction
├── PublicPlan/      # Built-in and custom holiday plans
├── BaseCalendar/    # Base calendar strategies
├── Intent/          # App Intents for Shortcuts
├── Notification/    # Local notification scheduling
├── Backup/          # iCloud backup and DB import/export
├── Database/        # GRDB models, migrations, persistence
├── ChineseCalendar/ # Lunar/Kyureki data support
└── More/            # Settings, about, tutorials, support

JSON Format for Custom Holiday Plan

Imported/exported plans follow this shape:

{
  "name": "My Plan",
  "start": "2027-01-01",
  "end": "2027-12-31",
  "days": [
    {
      "name": "New Year",
      "date": "2027-01-01",
      "type": 0,
      "localizedNames": {
        "en": "New Year",
        "zh-Hans": "元旦",
        "zh-Hant": "元旦"
      }
    }
  ]
}

name is the required original name. Optional localizedNames maps language codes (such as pt, th, ta, or zh-Hant) to translations, independently of the app’s interface languages. type is 0 for a day off or 1 for a workday. Dates must be valid, with years from 1 to 9999; legacy dates without zero padding remain supported. Existing templates without localizedNames remain compatible; missing or blank translations fall back to name. The earlier names key is accepted when reading; exports use localizedNames. If both keys are present, localizedNames takes precedence.

For templates with translations, choose Holiday Name Language from the calendar home screen’s top-right (…) menu. Original Names is the default. Changes take effect immediately and are remembered separately for each template. Imports, exports, copies, and subscription updates preserve translations. When editing a custom holiday, selecting a language updates that translation while preserving the original and other translations; Original Names edits name. Newly created holidays also receive an original name for fallback. Language selection affects display text; reminder grouping continues to use original names. Bundled 2027 entries include local official languages and simplified/traditional Chinese: English for Hong Kong and the US, Portuguese for Macao, English/Malay/Tamil for Singapore, and Japanese/Korean/Thai for their respective regions. Mainland and local Chinese templates initially include simplified/traditional Chinese; minority languages will follow later. Earlier entries retain their original names. Portuguese names follow the Macao government calendar; Thai names follow the Bank of Thailand notice. Singapore terminology follows MOM’s Malay guide and Tamil guide.

Reference model: Off Day/PublicPlan/Model/JSONPublicPlan.swift.

Roadmap

  • Built-in multi-region holiday templates
  • Custom template import/export
  • Base calendar modes (standard/week-cycle/day-cycle)
  • App Intents + automation workflow
  • Backup and restore
  • Interactive widget
  • Subscribable remote holiday templates with update review

Contributing

Issues and pull requests are welcome.

If you contribute holiday data:

  • Keep start/end aligned with actual dataset coverage.
  • Ensure all days[].date values stay within the range.
  • Keep JSON sorted and readable.

Screenshots

Off Day Screenshot

License

Off Day is available under the MIT License.

Jelajahi proyek terkait

Memuat…