sift-date
Sift expressions to check for older/newer dates
This extends sift with $older
and $newer
to filter Date
values being
newer/older than a reference Date
or an amount of time passed relative to
Date.now
Examples
const sift = const siftDate = sift
String Notation
The value to $older
/$newer
can be either a Date
or a duration in string notation:
The format of the string notation is amount unit
.
unit
must be one ofsecond
minute
hour
day
week
month
year
- Plural-s for
unit
is optional, e.g.1 year
is the same as1 years
amount
must be a number