Skip to content

Commit

Permalink
fix(docs): update readme with recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
brawaru committed Oct 13, 2023
1 parent c56f6fb commit b0c5048
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,15 @@ Describes a value within the time range that can be used as or converted to a ti
- `halfTrunc` — round values below or at half-increment towards 0, and values above away from 0.
- `halfEven` — round values at half-increment towards the nearest even value, values above it away from 0, and values below it towards 0.

Value of `null` will use `Math.round`. This value is only kept for backward compatibility and will be removed in the next major release, in which `"trunc"` will be made the new default.

**Default**: `null`.
**Default**: `'trunc'`.

- `unitRounding?` (`boolean`)

Whether to round to the nearest unit if the rounded duration goes above the threshold for the current unit.

For example, if 59.7 minutes round to 60 minutes, and this option is enabled, the duration will be rounded to use hour units, thus returning `"1 hour"`. Otherwise, the result of 60 minutes will be returned as is — `"60 minutes"`.

By default, this option is disabled (`false`) when the `roundingMode` is set to `null`, but enabled (`true`) otherwise. This will change in the next major update, in which this option will always be enabled (`true`) by default, regardless of the `roundingMode`.

**Default**: `false` (when `roundingMode` is `null`) or `true` (otherwise).
**Default**: `true`.

[`Intl.NumberFormat`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat
[`Intl.DateTimeFormatOptions`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options
Expand Down

0 comments on commit b0c5048

Please sign in to comment.