Changelog
All notable changes to Vali-Duration are documented here. Follows Keep a Changelog and Semantic Versioning.
[1.1.0]
Added
IParsable<ValiDuration>—Parse/TryParsehuman-readable duration strings (colon-separated"hh:mm:ss"/"mm:ss"or unit-labelled tokens like"2d 4h 30m 15s"), via the sharedDurationStringParserextracted fromVali-Time.IFormattable—ToString(string?, IFormatProvider?), using the format string asFormat(int)'sdecimalPlaceswhen it parses as a non-negative integer.- Added net10.0 target framework.
Changed
- Now depends on
Vali-Time1.1.0 (for the sharedDurationStringParser). No breaking changes.
[1.0.0] — 2025-07-01
Added
ValiDurationstruct with decimal precision for sub-millisecond accuracy.- Factory methods:
FromMilliseconds,FromSeconds,FromMinutes,FromHours,FromDays,FromWeeks. - Arithmetic operators:
+,-,*,/. - Comparison operators:
<,>,<=,>=,==,!=. IEquatable<ValiDuration>andIComparable<ValiDuration>implementations.- Implicit conversion to and from
TimeSpan. Format()for human-readable string output.As(TimeUnit)to convert the duration value into a specific unit.