• Returns true if the date object contains a valid value

    Parameters

    • date: Date

      date to validate

    Returns boolean

    const datetimeString1: string = '2021-03-25T01:00:00';
    const datetime1: Date = new Date(datetimeString1);
    isValidDate(datetime1); // true

    const datetimeString2: string = '2021-03-25T26:00:72';
    const datetime2: Date = new Date(datetimeString2);
    isValidDate(datetime2); // false