Skip to content

Commit 7c54ff2

Browse files
committed
Added canonicalize for Periods
1 parent 5cba88c commit 7c54ff2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/Dates/src/periods.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ julia> Dates.canonicalize(Dates.CompoundPeriod(Dates.Minute(50000)))
249249
4 weeks, 6 days, 17 hours, 20 minutes
250250
```
251251
"""
252+
canonicalize(x::Period) = canonicalize(CompoundPeriod(x))
252253
function canonicalize(x::CompoundPeriod)
253254
# canonicalize Periods by pushing "overflow" into a coarser period.
254255
p = x.periods

0 commit comments

Comments
 (0)