IsSameOrBefore adds the isSameOrBefore
method to EsDay indicating, if a date is the same as or before another date.
IsSameOrBefore has no dependencies on other plugins.
esday().isSameOrBefore(date: DateType, unit?: UnitType): boolean
parameter | description |
---|---|
date | date to compare with |
unit | unit to use for comparison |
import { esday } from 'esday'
import isSameOrBeforePlugin from 'esday/plugins/isSameOrBefore'
esday.extend(isSameOrBeforePlugin)
esday('2010-10-20').isSameOrBefore('2010-10-19', 'day')
// Returns false