• JMap.Util.Date.isAfter

    Returns true if the first date is after the second date.

    Parameters

    • date1: JDateLike

      Date object, or ISO string, or timestamp number

    • date2: JDateLike

      Date object, or ISO string, or timestamp number

    • Optional checkTime: boolean

      if true will also check the date time, else check only the date

    Returns boolean

    Throws

    if dates are not Date object, or ISO string, or timestamp number

    Example

    // returns in the user's locale language, the time that will pass, or passed from now for the given date
    const firstDate = new Date()
    setTimeout(() => {
    const secondDate = new Date()
    // will return false (time is not checked)
    JMap.Util.Date.isAfter(secondDate, firstDate)

    // will return true (because also check the time)
    JMap.Util.Date.isAfter(secondDate, firstDate, true)
    }, 1000)