RoundTo

sealed external interface RoundTo<T : DateTimeUnit<T>>(source)

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

Link copied to clipboard
abstract var roundingIncrement: Int?

Allows rounding to an integer number of units. For example, to round to increments of a half hour, use { smallestUnit: 'minute', roundingIncrement: 30 }.

Link copied to clipboard
abstract var roundingMode: RoundingMode?

Controls how rounding is performed:

Link copied to clipboard
abstract var smallestUnit: SmallestUnit<T>

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.