RoundTo
round
methods take one required parameter. If a string is provided, the resulting Temporal.Duration
object will be rounded to that unit. If an object is provided, its smallestUnit
property is required while other properties are optional. A string is treated the same as an object whose smallestUnit
property value is that string.
Properties
Allows rounding to an integer number of units. For example, to round to increments of a half hour, use { smallestUnit: 'minute', roundingIncrement: 30 }
.
Controls how rounding is performed:
The unit to round to. For example, to round to the nearest minute, use smallestUnit: 'minute'
. This option is required. Note that the same-named property is optional when passed to until
or since
methods, because those methods do no rounding by default.