calendar-math

Implement calendar algorithms and date conversions in vanilla JavaScript.

26|6|Updated Apr 14, 2024
One-click install
npx skills add https://github.com/CodapopKSP/LibraryOfTime --skill calendar-math
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: calendar-math
Source: https://github.com/CodapopKSP/LibraryOfTime/tree/main/.cursor/skills/calendar-math
Command: npx skills add https://github.com/CodapopKSP/LibraryOfTime --skill calendar-math

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Library of Time requires reliable, end‑to‑end calendar and timekeeping modules that can handle a wide variety of calendar systems, perform accurate date conversions, and integrate with existing UI and testing frameworks.

Core Features & Use Cases

  • Full Calendar Implementation: Design and code complete calendar algorithms (solar, lunar, lunisolar, etc.) within the vanilla JavaScript CalendarAPI layer.
  • Date Conversion & Anchor Handling: Convert dates to and from stable Gregorian anchors, respecting user‑specified rules and avoiding undocumented assumptions.
  • Integration & Testing: Wire new calendars into the site UI, update documentation, and provide comprehensive automated tests covering edge cases and leap rules.

Quick Start

Ask the calendar-math skill to add a new lunisolar calendar using the given anchor dates and generate the necessary conversion functions and tests.

Frequently Asked Questions about calendar-math

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a custom lunisolar calendar algorithm in vanilla JavaScript?

Converting dates to stable Gregorian anchors requires respecting user-specified rules and avoiding undocumented assumptions. You implement precise conversion functions within the vanilla JavaScript CalendarAPI layer to ensure accurate timekeeping.

How do I add automated tests for calendar date conversion edge cases?

Adding automated tests for calendar date conversion edge cases involves generating comprehensive test suites that cover leap rules and boundary conditions. This validates the vanilla JavaScript calendar algorithms and ensures reliable timekeeping integration.

Does this calendar math approach work with vanilla JavaScript without external dependencies?

Designing new calendars within the Library of Time project serves the purpose of providing reliable, end-to-end calendar and timekeeping modules. It handles diverse calendar systems, performs accurate date conversions, and integrates with existing UI and testing frameworks.

What's the best way to wire a new calendar module into the site UI?

The best way to wire a new calendar module into the site UI is to implement the vanilla JavaScript calendar algorithms using the CalendarAPI layer, then connect the conversion functions directly to the existing UI and testing frameworks.

Why do my date conversion functions make undocumented assumptions about leap rules?

Date conversion functions make undocumented assumptions about leap rules when they do not explicitly respect user-specified rules. You must apply precise calendar calculations to anchor dates accurately and avoid hidden logic in the conversion process.