An open API service indexing awesome lists of open source software.

https://github.com/jeffreysarnoff/compoundperiods.jl

enhances Dates.CompoundPeriod
https://github.com/jeffreysarnoff/compoundperiods.jl

julia periods time

Last synced: 2 months ago
JSON representation

enhances Dates.CompoundPeriod

Awesome Lists containing this project

README

        

## CompoundPeriods.jl
### Some enhancements for Dates.CompoundPeriod

----

#### Copyright © 2018 by Jeffrey Sarnoff.    Released under The MIT License.

-----

[![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](http://jeffreysarnoff.github.io/CompoundPeriods.jl/latest/)


-----
This package enhances the CompoundPeriod type defined within Dates (Dates.CompoundPeriod). A CompoundPeriod is formed by attaching (adding) two or more distinct Periods:

```julia
julia> using Dates

julia> typeof( Year(1999) ), typeof( Hour(15) )
Year, Hour

julia> typeof( Year(1999) + Hour(15) )
Dates.CompoundPeriod
```

Note that `typeof( compound_period )` is shown as `CompoundPeriod` rather than `Dates.CompoundPeriod`. This lets you know that enhanced CompoundPeriods are in use.

```julia
julia> using CompoundPeriods, Dates

julia> typeof( Year(1999) + Hour(15) )
CompoundPeriod
```