round
Rounds a TheDate to the specified unit (unit).
Interactive example
Syntax
typescript
function round(
input: TheDate,
unit?: RoundUnit
): TheDateRoundUnit corresponds to Unit without the millisecond option (day, week, month, year, etc.).
Parameters
input: Date to round.unit: Target unit (dayby default).
Return value
A TheDate rounded to the requested unit.
