You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: support comma as decimal separator (ISO 8601 European format) (#11)
Add support for comma (,) as a decimal separator in fractional seconds
for both time and duration components, as specified in ISO 8601.
Changes:
- Parser now accepts both . and , as decimal separators
- Stringify normalizes all output to canonical . notation
- Added comprehensive test coverage for both formats
- Updated documentation with European format examples
This improves ISO 8601 compliance and enables parsing of temporal
strings from European locales where comma is the standard decimal
separator (e.g., "T10:30:45,123" and "PT1,5S").
fix: Support comma as decimal separator in fractional seconds (European format)
6
+
7
+
Add support for comma (`,`) as a decimal separator in fractional seconds for both time and duration components, as specified in ISO 8601. This enables parsing of European-formatted temporal strings while maintaining canonical dot (`.`) notation in serialized output.
8
+
9
+
**Supported formats:**
10
+
- Time with fractional seconds: `T10:30:45,123` → `T10:30:45.123`
11
+
- Duration with fractional seconds: `PT1,5S` → `PT1.5S`
12
+
13
+
**Behavior:**
14
+
- Parser accepts both `.` and `,` as decimal separators
15
+
- Stringify normalizes all output to use `.` for consistency
16
+
- Full round-trip compatibility maintained
17
+
18
+
This change improves ISO 8601 compliance and enables parsing of temporal strings from European locales where comma is the standard decimal separator.
0 commit comments