This file contains a series of functionalities that allow the generations of range dates.
Methods
# static genDates(to, num, unit, wholeDay) → {object}
Generate a date range following the params specifications.
Parameters:
Name | Type | Description |
---|---|---|
to |
number
|
End timestamp. Default now(). |
num |
number
|
Number of units to subtract from "to". |
unit |
string
|
Unit. |
wholeDay |
boolean
|
Specify whether "from" and "to" start at the beginning of the day. |
- An object with from and to timestamp values.
object
# static genDates30DaysFromYesterday() → {object}
Get the date range of the previous 30 days.
- An object with from and to timestamp values.
object
# static genDatesToday() → {object}
Get a range date of the current date starting at 00:00 hours.
- An object with from and to timestamp values.
object
# static genDatesYesterday() → {object}
Get yesterday's date range.
- An object with from and to timestamp values.
object
# static genRangeDates(start, end, jump, format) → {Array.<number>}
Generate a range of dates between the two passed dates.
Parameters:
Name | Type | Description |
---|---|---|
start |
number
|
The start timestamp. |
end |
number
|
The end timestamp. |
jump |
string
|
The jump for every iter: 'days', 'weeks', 'months'... |
format |
string
|
The format for the result dates. |
- Array of datetimes range.
Array.<number>