File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ Standard library changes
68
68
69
69
#### Dates
70
70
71
+ * The ` Dates.periods ` function can be used to get the ` Vector ` of ` Period ` s that comprise a ` CompoundPeriod ` ([ #39169 ] ).
71
72
72
73
#### Statistics
73
74
Original file line number Diff line number Diff line change @@ -747,6 +747,7 @@ Dates.Period(::Any)
747
747
Dates.CompoundPeriod(::Vector{<:Dates.Period})
748
748
Dates.value
749
749
Dates.default
750
+ Dates.periods
750
751
```
751
752
752
753
### Rounding Functions
Original file line number Diff line number Diff line change @@ -196,6 +196,13 @@ struct CompoundPeriod <: AbstractTime
196
196
end
197
197
end
198
198
199
+ """
200
+ Dates.periods(::CompoundPeriod) -> Vector{Period}
201
+
202
+ Return the `Vector` of `Period`s that comprise the given `CompoundPeriod`.
203
+ """
204
+ periods (x:: CompoundPeriod ) = x. periods
205
+
199
206
"""
200
207
CompoundPeriod(periods) -> CompoundPeriod
201
208
Original file line number Diff line number Diff line change 366
366
@test isequal (d - h, 2 d - 2 h - 1 d + 1 h)
367
367
@test sprint (show, y + m) == string (y + m)
368
368
@test convert (Dates. CompoundPeriod, y) + m == y + m
369
+ @test Dates. periods (convert (Dates. CompoundPeriod, y)) == convert (Dates. CompoundPeriod, y). periods
369
370
end
370
371
@testset " compound period simplification" begin
371
372
# reduce compound periods into the most basic form
You can’t perform that action at this time.
0 commit comments