jalaali v0.2.1 Jalaali.Calendar View Source
A calendar implementation based on jalaali calendar system
Link to this section Summary
Functions
Converts the given date into a string
Converts a Date struct to string human readable format
Convers the datetime (with time zone) into a human readable string
Returns day of week on a spesific set of year, month and day
In Jalaali calendar new day starts at midnight.
This function always returns {0, 1}
as result
Converts the t:Calendar.iso_days
format to the datetime format specified by this calendar
Returns the t:Calendar.iso_days
format of the specified date
Converts the datetime (without time zone) into a human readable string
Converts a day fraction to this Calendar’s representation of time
Returns the normalized day fraction of the specified time
Converts the given time into a string
Link to this section Types
Link to this section Functions
Converts the given date into a string.
Converts a Date struct to string human readable format
- Extended type of string date. e.g.: “2017-01-05”
:extended
- Basic type of string date. e.g.: “20170105”
:basic
Convers the datetime (with time zone) into a human readable string.
day_of_week(year, month, day) :: day_of_week
Returns day of week on a spesific set of year, month and day
In Jalaali calendar new day starts at midnight.
This function always returns {0, 1}
as result.
naive_datetime_from_iso_days(Calendar.iso_days) :: {Calendar.year, Calendar.month, Calendar.day, Calendar.hour, Calendar.minute, Calendar.second, Calendar.microsecond}
Converts the t:Calendar.iso_days
format to the datetime format specified by this calendar.
naive_datetime_to_iso_days(Calendar.year, Calendar.month, Calendar.day, Calendar.hour, Calendar.minute, Calendar.second, Calendar.microsecond) :: Calendar.iso_days
Returns the t:Calendar.iso_days
format of the specified date.
Converts the datetime (without time zone) into a human readable string.
time_from_day_fraction(Calendar.day_fraction) :: {Calendar.hour, Calendar.minute, Calendar.second, Calendar.microsecond}
Converts a day fraction to this Calendar’s representation of time.
Examples
iex> Calendar.ISO.time_from_day_fraction({1,2})
{12, 0, 0, {0, 6}}
iex> Calendar.ISO.time_from_day_fraction({13,24})
{13, 0, 0, {0, 6}}
time_to_day_fraction(Calendar.hour, Calendar.minute, Calendar.second, Calendar.microsecond) :: Calendar.day_fraction
Returns the normalized day fraction of the specified time.
Examples
iex> Calendar.ISO.time_to_day_fraction(0, 0, 0, {0, 6})
{0, 86400000000}
iex> Calendar.ISO.time_to_day_fraction(12, 34, 56, {123, 6})
{45296000123, 86400000000}
Converts the given time into a string.