Function TryStrToDate

  • Parses the given string as a date, drops any time given

    const [success, date] = TryStrToDate(SomeStr);
    if (success) {
    // ...date is valid!
    }

    Parameters

    • S: string

    Returns [boolean, Date | undefined]