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

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 type day_of_week() View Source
day_of_week() :: 1..7
Link to this type hour() View Source
hour() :: 0..23
Link to this type microsecond() View Source
microsecond() :: Integer.t
Link to this type minute() View Source
minute() :: 0..59
Link to this type month() View Source
month() :: 1..12
Link to this type second() View Source
second() :: 0..60
Link to this type year() View Source
year() :: 0..9999

Link to this section Functions

Link to this function date_to_string(year, month, day) View Source
date_to_string(year, month, day) :: String.t

Converts the given date into a string.

Link to this function date_to_string(year, month, day, atom) View Source
date_to_string(year, month, day, :extended | :basic) :: String.t

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
Link to this function datetime_to_string(year, month, day, hour, minute, second, microsecond, time_zone, zone_abbr, utc_offset, std_offset) View Source

Convers the datetime (with time zone) into a human readable string.

Link to this function day_of_week(year, month, day) View Source
day_of_week(year, month, day) :: day_of_week

Returns day of week on a spesific set of year, month and day

Link to this function day_rollover_relative_to_midnight_utc() View Source

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.

Link to this function naive_datetime_to_iso_days(year, month, day, hour, minute, second, microsecond) View Source

Returns the t:Calendar.iso_days format of the specified date.

Link to this function naive_datetime_to_string(year, month, day, hour, minute, second, microsecond) View Source
naive_datetime_to_string(year, month, day, hour, minute, second, microsecond) :: String.t

Converts the datetime (without time zone) into a human readable string.

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}}
Link to this function time_to_day_fraction(hour, minute, second, arg) View Source

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}
Link to this function time_to_string(hour, minute, second, microsecond) View Source

Converts the given time into a string.

Link to this function time_to_string(hour, minute, second, arg, format) View Source