Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Date.isBeforeOrEqual

$date.isBeforeOrEqual($otherDate) -> boolean

Description

Return true is Date object is before or equal to $otherDate.

$otherDate can be one of the following:

$now = Date.now()

$lastWeek = $now.add('-7 days')
$nextWeek = $now.add('7 days')

$lastWeek.isBeforeOrEqual($now)
//= true

$nextWeek.isBeforeOrEqual('tomorrow')
//= false

See Also