calendar-conventions

Encode calendar and timekeeping conventions for the Library of Time project.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses inconsistencies in implementing calendars and timekeeping systems, preventing errors in date conversions, timezone handling, and epoch calculations that could lead to inaccurate historical or cultural date representations in the Library of Time project.

Core Features & Use Cases

  • Core Conventions: Defines standards for year numbering (including BCE as negative integers), preferring createAdjustedDateTime over raw Date constructors, and explicit epoch anchors in local timezones.
  • Implementation Guidance: Covers day-boundary logic with non-midnight starts (e.g., sunrise), load-time safety to avoid script dependencies, and patterns for conversion functions like toGregorian and fromGregorian.
  • Use Case: When adding a new lunisolar calendar like the Hebrew system, use this Skill to ensure weekday calculations align with sunset boundaries and all arithmetic uses shared utilities for consistency across the project.

Quick Start

Apply the calendar-conventions skill to refactor the Coptic calendar logic in CalendarAPI/Calendars ensuring proper BCE handling and timezone offsets.

Frequently Asked Questions about calendar-conventions

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

FAQPage Schema
How do I handle BCE years and negative integers when building a JavaScript calendar system?

Calendar systems should handle BCE years by using negative integers for year numbering. Using shared utilities like createAdjustedDateTime instead of raw Date constructors ensures consistent epoch calculations and accurate historical date representations.

What is the best way to manage timezones and day boundaries for non-midnight starts like sunrise?

Non-midnight day boundaries require explicit day-boundary logic that accounts for sunset or sunrise starts. Calendar conventions standardize this logic so weekday calculations align correctly with cultural or lunisolar day transitions.

How do I implement toGregorian and fromGregorian conversion functions for a lunisolar calendar?

Gregorian conversion functions require using shared utilities like createAdjustedDateTime rather than raw Date constructors. This ensures timezone offsets and day boundaries are consistently applied across all arithmetic operations.

Why does my JavaScript calendar logic break due to load-time dependencies?

Calendar logic breaks when scripts rely on load-time dependencies that execute before required utilities are available. Avoiding these dependencies and using explicit anchor dates in local timezones ensures safe, predictable date calculations.

Does this calendar convention approach work for refactoring Coptic calendar logic with timezone offsets?

This approach works for refactoring Coptic calendar logic by enforcing proper BCE handling and timezone offsets. It applies standardized conventions to Calendar API layers, ensuring consistent date conversions and epoch anchors.

When should I use explicit epoch anchors in local timezones for timekeeping systems?

Explicit epoch anchors in local timezones are needed when implementing or refactoring calendar logic to prevent date conversion errors. They provide a stable reference point for epoch calculations and ensure consistent timekeeping across different calendar systems.