Constructor
Optional
duration: stringISO 8601 Duration
Private
Optional
_endPrivate
Optional
_startNumber of days
Number of hours
True if it represents a negative period
Number of microseconds.
Number of minutes
NUmber of months
Number of seconds
Number of years
Static
Private
convertersCompare with given interval
Returns:
number
Format the interval to a string.
You can use the following characters. You can escape a character with a \ to output it as given:
Y Years, numeric, at least 2 digits with leading 0, eg. 01, 03 y Years, numeric 1, 3 M Months, numeric, at least 2 digits with leading 0, eg. 01, 03, 12 m Months, numeric, eg. 1, 3, 12 D Days, numeric, at least 2 digits with leading 0, eg. 01, 03, 31 d Days, numeric, eg. 1, 3, 31 a Total number of days as a result of a DateTime.diff or (unknown) otherwise, eg. 4, 18, 8123 H Hours, numeric, at least 2 digits with leading 0, eg. 01, 03, 23 h Hours, numeric, eg. 1, 3, 23 I Minutes, numeric, at least 2 digits with leading 0, eg. 01, 03, 59 i Minutes, numeric, eg. 1, 3, 59 j The total number of minutes as a result of a DateTime.diff or (unknown) if this duration holds more than hours and minutes and seconds, eg. 4, 18, 8123 S Seconds, numeric, at least 2 digits with leading 0, eg. 01, 03, 57 s Seconds, numeric, eg. 1, 3, 57 F Microseconds, numeric, at least 6 digits with leading 0, eg. 007701, 052738, 428291 f Microseconds, numeric, eg. 7701, 52738, 428291 R Sign "-" when negative, "+" when positive, eg. -, + r Sign "-" when negative, empty when positive, eg. -,
Calculates total number of days that have elapsed between two dates.
Only available if this diff was created using DateTime.diff
Calculates total number of minutes that have elapsed between two dates.
Only available if this diff was created using DateTime.diff
Static
Private
createStatic
createCreate date by given format. See DateInterval.format.
Does not support "a". "j" can only be used alone.
const dateInterval = DateInterval.createFromFormat("21:09", "h:I"));
const dateInterval = DateInterval.createFromFormat("315", "j"));
Generated using TypeDoc
DateInterval class
Represents a date interval.
Commonly created via DateTime.diff