The start of the interval
The end of the interval
Optional
options: FormatDurationInUnitsOptionsOptions to pass for calculation duration in units
A string representing the duration between the start and end date in the specified number of units
formatDurationInUnits('2021-01-01', '2021-01-02', { numberOfUnits: 2 });
// => '1 day'
formatDurationInUnits('2021-01-01', '2021-02-02', { numberOfUnits: 2, delimiter: ', ' });
// => '1 month, 1 day'
Generated using TypeDoc
Formats the duration between two dates in the specified number of units