-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I would be great to have a function to convert a string to an MIT of the correct frequency.
For instance:
frequencymap = Dict{Char,Any}(
'Q' => Quarterly,
'M' => Monthly,
'Y' => Yearly,
)
convert_string_to_mit(t::AbstractString) = length(t) > 5 ? MIT{frequencymap[t[5]]}(parse(Int, t[1:4]), parse(Int, t[6:end])) : MIT{Yearly}(parse(Int, t[1:4]))
convert_string_to_mit("2022")
convert_string_to_mit("2022M11")
convert_string_to_mit("2022Q3")
We could also use Julia's syntax: convert(MIT{Monthly},"2022M1")
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request