@onereach/time-interpreter
Version:
Convert dates, durations and time to canonical format (dates -> ISO 8601, durations -> milliseconds).
55 lines (38 loc) • 1.97 kB
Markdown
### 1.0.27 (2023-3-16)
[FIX] fix ci
# 1.0.13
* Release June 3, 2021
Fixed module importation in unit tests. Updated `formatDuration` method, added an ability to define duration units: `year, month, week, day, hour, minute, min, second, sec`. Added tests for this update.
# 1.0.14
* Release June 10, 2021
Updated `formatDatetime` and `parse` methods, added an ability to define dates in formats : `YYYY-MM-DD[T]HH:mm:ss[Z]Z`, `YYYY-MM-DD[T]HH:mm[Z]Z`. Added tests for this update.
# 1.0.15
* Release October 1, 2021
Added an ability to define time, for example : `07pm`, `03:15:00 am`, `06:30am`, `3:00`, `10-01:00`, `3:16+01:00`, `3:16:00+01:00`, `3:16`. Added unit tests for this update.
# 1.0.16
* Release October 11, 2021
Remove valid year range `1000-2999` and set validation that a year should be four digits. Added unit tests for this update.
# 1.0.17
* Release October 11, 2021
Add additional property *"isoWithFractSec"* to output data for methods `parse()` and `formatDatetime()` and property *"timeWithFractSec"* for method `formatTime()`, that contains date in format `YYYY-MM-DD[T]HH:mm:ss.SSSZ`.
# 1.0.19
* Release April 7, 2022
Add an opportunity to output duration as an object `{asMilliseconds: 172800000, asObject: {days: 2}, humanized: "2 days"}` by indicated `true` as a second parameter: `formatDuration('2d', true)`.
# 1.0.21
* Release September 7, 2022
Fix timezone handler for parsing value in minutes (valid range from -720 to 840): `-300, +60`.
# 1.0.22
* Release September 21, 2022
Add more validation for timezone value in minutes.
# 1.0.23
* Release October 17, 2022
Add validation for timezone offset.
# 1.0.24
* Release October 24, 2022
Fix time zone (`+12:45`) assignment on date value.
# 1.0.25
* Release January 11, 2023
Fix time zone assignment on date value, improve regular expressions.
# 1.0.26
* Release March 14, 2023
Duration validation: exclude negative duration value. Negative duration value is invalid duration.