github jacobras/Human-Readable 2.0.0-alpha01

pre-release4 hours ago

PREVIEW of v2, the biggest update to the library yet. All changes are in the time section. Backwards compatible with v1, but with a slight behavioural fix: default rounding HalfUp is now consistent.

  • Added: date formatting styles
    • Long: "1 hour, 50 minutes"
    • Short: "1 hr, 50 min"
    • Narrow: "1h 50m"
  • Added: time formatting styles
    • Regular: "1 hour, 50 minutes"
    • Digital: "01:50:00
  • Added: multi-part formatting + cut-off rules for subparts
  • Added: smallest duration to format
  • Added: approximation word (prefixing "about" if formatted time is not exact (i.e. a part was dropped or rounded)
  • Added: limited units formatting
  • Added: today/tomorrow/yesterday formatting
  • Added: configurable rounding (on the last part only, in case of multi-part formatting)
    • HalfUp (default)
    • Floor
    • IfClose (rounds up on 55 seconds/55 minutes/23 hours/13 days, configurable)
  • Changed: custom i18n implementation
  • Added: support for tvOS, watchOS and native targets linuxArm64, linuxX64, macosArm64, mingwX64

Full Changelog: 1.13.0...2.0.0-alpha01

Don't miss a new Human-Readable release

NewReleases is sending notifications on new releases.