Function isValidDateYear

  • Checks if the provided year is a valid date year.

    Parameters

    • year: number

      The year to be checked.

    Returns boolean

    A boolean indicating whether the year is valid or not.

    Remarks

    This function will return true if the year is a positive integer, false otherwise.

    Example

    isValidDateYear(2020); ;
    //=> true
    isValidDateYear(-2020);;
    //=> false
    isValidDateYear(2020.5);;
    //=> false

Generated using TypeDoc