lanka-validations - v2.1.0
    Preparing search index...

    Function isValidCalendarDate

    • Checks if the given year, month (1-12), and day (1-31) represent a valid calendar date.

      Parameters

      • year: number

        Year between 1800 and 2200.

      • month: number

        Month, 1 to 12.

      • day: number

        Day of the month.

      Returns boolean

      true if the date exists.

      isValidCalendarDate(2024, 2, 29); // true
      isValidCalendarDate(2023, 2, 29); // false