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