Quantum v2.3.4 Quantum.DateLibrary.Calendar View Source
calendar
implementation of Quantum.DateLibrary
.
This behaviour is considered internal. Breaking Changes can occur on every release.
Installation
config.exs
config :quantum,
date_library: Quantum.DateLibrary.Calendar
mix.exs
defp deps do
[{:quantum, "*"},
{:calendar, "*"}]
end
Link to this section Summary
Functions
Gives back the required application dependency to start, if any is needed
Convert NaiveDateTime
in given tz to NaiveDateTime
in UTC
Convert NaiveDateTime
in UTC to NaiveDateTime
in given tz
Link to this section Functions
Gives back the required application dependency to start, if any is needed.
Callback implementation for Quantum.DateLibrary.dependency_application/0
.
Link to this function
tz_to_utc!(date, tz)
View Source
tz_to_utc!(NaiveDateTime.t(), String.t()) :: NaiveDateTime.t() | no_return()
Convert NaiveDateTime
in given tz to NaiveDateTime
in UTC.
- Should raise an
InvalidDateTimeForTimezoneError
if the time is not valid. - Should raise an
InvalidTimezoneError
if the timezone is not valid.
Callback implementation for Quantum.DateLibrary.tz_to_utc!/2
.
Link to this function
utc_to_tz!(date, tz)
View Source
utc_to_tz!(NaiveDateTime.t(), String.t()) :: NaiveDateTime.t() | no_return()
Convert NaiveDateTime
in UTC to NaiveDateTime
in given tz.
- Should raise an
InvalidTimezoneError
if the timezone is not valid.
Callback implementation for Quantum.DateLibrary.utc_to_tz!/2
.