Skip to content

Instantly share code, notes, and snippets.

@JeffreySarnoff
Last active July 27, 2017 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffreySarnoff/db5895db11cd4aabd372efbe5bc4c5a8 to your computer and use it in GitHub Desktop.
Save JeffreySarnoff/db5895db11cd4aabd372efbe5bc4c5a8 to your computer and use it in GitHub Desktop.
module TemporalAbstractions
export AbstractTime,
AbstractCalendar, AbstractDate, AbstractTimeOfDay,
AbstractDateTime, AbstractDateTimeZone
import Base.Dates: AbstractTime
abstract type TemporalAbstraction end
# parameter T for TemporalResolution realization (e.g. smallest time step available: day, nanosecond)
# either as a symbol or as any other type enfolding
abstract type TemporalResolution{T} <: TemporalAbstraction end
abstract type AbstractTimes{T} <: TemporalResolution{T} end
abstract type AbstractCalendar{T} <: AbstractTimes{T} end
# BusinessDays defines HolidayCalendar as an abstract type
# this would be its supertype (if Felipe agrees .. he has been agreeable to date).
abstract type AbstractDate{T} <: AbstractTimes{T} end
# ideally, Base.Dates.Date would become a subtype of this
abstract type AbstractTimeOfDay{T} <: AbstractTimes{T} end
# ideally, Base.Dates.Time would become a subtype of this
abstract type AbstractDateTime{T} <: AbstractTimes{T} end
# ideally, Base.Dates.DateTime would become a subtype of this
abstract type AbstractDateTimeZone{T} <: AbstractDateTime{T} end
# ZonedDateTime <: this
end # module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment