Function isValidDateDay

  • Checks if the given day is a valid day of the month.

    Parameters

    • day: number

      The day of the month. Must be an integer.

    • month: number

      The month of the year. Must be an integer.

    • Optional year: number

      The year. Optional parameter. If not provided, the function will not check for leap years.

    Returns boolean

    A boolean indicating whether the day is valid for the given month and year.

    Example

    isValidDateDay(31, 1, 2000);
    //=> true
    isValidDateDay(31, 2, 2000);
    //=> false
    isValidDateDay(29, 2);
    //=> true

Generated using TypeDoc