Celestine API Documentation - v0.2.0
    Preparing search index...

    Function isValidDate

    • Validate a calendar date

      Checks if the year, month, and day form a valid date. Takes leap years into account.

      Note: Year 0 doesn't exist historically (1 BCE → 1 CE), but we allow it for astronomical calculations (ISO 8601 uses year 0 = 1 BCE).

      Parameters

      • year: number

        Full year number

      • month: number

        Month (1-12)

      • day: number

        Day of month

      Returns boolean

      true if valid date, false otherwise

      isValidDate(2024, 2, 29)   // true (leap year)
      isValidDate(2023, 2, 29) // false (not leap year)
      isValidDate(2024, 13, 1) // false (invalid month)
      isValidDate(2024, 4, 31) // false (April has 30 days)