Module

Calendar

Changes by version

Elixir 1.19.0

· 1 change

Enhancement Tool: Elixir

Support 2-arity options for Calendar.strftime/3 which receives the whole data type

Elixir 1.18.0

· 1 change

Enhancement Tool: Elixir

Add Duration.to_string/1

Elixir 1.15.0

· 2 changes

Enhancement Tool: Elixir

Add support for epoch time (%s) to Calendar.strftime/2

Hard Deprecation Tool: Elixir

Calendar.ISO.day_of_week/3 is deprecated in favor of Calendar.ISO.day_of_week/4

Elixir 1.14.3

· 1 change

Bugfix Tool: Elixir

Fix handling of negative years in Calendar.strftime/2

Elixir 1.14.0

· 3 changes

Enhancement Tool: Elixir

Support ISO8601 basic format parsing with DateTime.from_iso8601/2

Enhancement Tool: Elixir

Add day/hour/minute on add/diff across different calendar modules

Bugfix Tool: Elixir

Handle widths with "0" in them in Calendar.strftime/3

Elixir 1.13.0

· 1 change

Enhancement Tool: Elixir

Add c:Calendar.year_of_era/3 to support calendars where the beginning of a new era does not align with the beginning of a new year

Elixir 1.12.0

· 1 change

Enhancement Tool: Elixir

Support basic datetime format in Calendar.ISO parsing functions

Elixir 1.11.0

· 6 changes

Enhancement Tool: Elixir

Add Calendar.strftime/3 for datetime formatting

Enhancement Tool: Elixir

Add linear integer representations to Calendar modules: Date.from_gregorian_days/2, Date.to_gregorian_days/1, NaiveDateTime.from_gregorian_seconds/3, NaiveDateTime.to_gregorian_seconds/1, Time.from_seconds_after_midnight/1, and Time.to_seconds_after_midnight/1

Enhancement Tool: Elixir

Add new! to Date/Time/NaiveDateTime/DateTime (new has also been added to DateTime for completeness)

Enhancement Tool: Elixir

Support custom starting day of the week in Date.day_of_week/2

Enhancement Tool: Elixir

Add Date.beginning_of_month/1 and Date.end_of_month/1

Enhancement Tool: Elixir

Add Date.beginning_of_week/2 and Date.end_of_week/2

Elixir 1.10.0

· 2 changes

Enhancement Tool: Elixir

Allow custom calendar representations in calendar sigils

Enhancement Tool: Elixir

Add c:Calendar.parse_time/1, c:Calendar.parse_date/1, c:Calendar.parse_naive_datetime/1 and c:Calendar.parse_utc_datetime/1 callbacks to calendar behaviour

Elixir 1.8.0

· 3 changes

Enhancement Tool: Elixir

Add Calendar.TimeZoneDatabase and a Calendar.UTCOnlyTimeZoneDatabase implementation

Enhancement Tool: Elixir

Add callbacks day_of_year/3, quarter_of_year/3, year_of_era/1, and day_of_era/3

Bugfix Tool: Elixir

Allow printing dates with more than 9999 years

Elixir 1.7.4

· 1 change

Bugfix Tool: Elixir

Fix for converting from negative iso days on New Year in a leap year

Elixir 1.7.1

· 1 change

Bugfix Tool: Elixir

Work-around a Dialyzer bug that causes it to loop for a long time, potentially indefinitely

Elixir 1.7.0

· 1 change

Enhancement Tool: Elixir

Add Calendar.months_in_year/1 callback

Elixir 1.6.0

· 1 change

Enhancement Tool: Elixir

Add truncate to Time, DateTime and NaiveDateTime to facilitate microsecond precision pruning

Elixir 1.5.3

· 1 change

Bugfix Tool: Elixir

Consider microseconds in maximum possible Calendar.ISO datetime

Elixir 1.5.0

· 8 changes

Enhancement Tool: Elixir

Implement Inspect for DateTime with Calendar.ISO

Enhancement Tool: Elixir

Add "ISO days" format for conversions between Calendars and Date.convert/2, Time.convert/2, NaiveDateTime.convert/2 and DateTime.convert/2 (as well as bang variants)

Enhancement Tool: Elixir

Add :calendar field to Time struct

Enhancement Tool: Elixir

Add Time.diff/3, Date.add/2, Date.diff/2, DateTime.diff/3

Enhancement Tool: Elixir

Add Date.range/2

Enhancement Tool: Elixir

Add Date.new/4, DateTime.utc_now/1, NaiveDateTime.new/8 and Time.new/5 that allow specifing calendar

Bugfix Tool: Elixir

Ensure Calendar.ISO raises a readable error when reaching up the year 10000 restriction

Bugfix Tool: Elixir

Return {:error, :invalid_time} for wrong precision instead of crashing when parsing ISO dates

Elixir 1.4.2

· 1 change

Bugfix Tool: Elixir

Correct typo on Calendar types

Elixir 1.4.0

· 4 changes

Enhancement Tool: Elixir

Add Date.compare/2, Time.compare/2, NaiveDateTime.compare/2 and DateTime.compare/2

Enhancement Tool: Elixir

Support NaiveDateTime.add/3 and NaiveDateTime.diff/3 for adding seconds (up to microseconds) as well as the difference between two NaiveDateTimes in seconds (up to microseconds)

Enhancement Tool: Elixir

Add Date.leap_year?/1 and Date.day_of_week/1

Enhancement Tool: Elixir

Ensure Date, Time and NaiveDateTime APIs work with any struct that provides the same set of fields as their respective struct. For example, a NaiveDateTime can be given to Date since it contains a superset of the fields in the Date struct

Elixir 1.3.0

· 1 change

Enhancement Tool: Elixir

Add Calendar and Date, Time, NaiveDateTime and DateTime types