Support 2-arity options for Calendar.strftime/3 which receives the whole data type
Module
Calendar
40 changes across 19 versions
Changes by version
Add Duration.to_string/1
Add support for epoch time (%s) to Calendar.strftime/2
Calendar.ISO.day_of_week/3 is deprecated in favor of Calendar.ISO.day_of_week/4
Fix handling of negative years in Calendar.strftime/2
Support ISO8601 basic format parsing with DateTime.from_iso8601/2
Add day/hour/minute on add/diff across different calendar modules
Handle widths with "0" in them in Calendar.strftime/3
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
Support basic datetime format in Calendar.ISO parsing functions
Add Calendar.strftime/3 for datetime formatting
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
Add new! to Date/Time/NaiveDateTime/DateTime (new has also been added to DateTime for completeness)
Support custom starting day of the week in Date.day_of_week/2
Add Date.beginning_of_month/1 and Date.end_of_month/1
Add Date.beginning_of_week/2 and Date.end_of_week/2
Allow custom calendar representations in calendar sigils
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
Add Calendar.TimeZoneDatabase and a Calendar.UTCOnlyTimeZoneDatabase implementation
Add callbacks day_of_year/3, quarter_of_year/3, year_of_era/1, and day_of_era/3
Allow printing dates with more than 9999 years
Fix for converting from negative iso days on New Year in a leap year
Work-around a Dialyzer bug that causes it to loop for a long time, potentially indefinitely
Add Calendar.months_in_year/1 callback
Add truncate to Time, DateTime and NaiveDateTime to facilitate microsecond precision pruning
Consider microseconds in maximum possible Calendar.ISO datetime
Implement Inspect for DateTime with Calendar.ISO
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)
Add :calendar field to Time struct
Add Time.diff/3, Date.add/2, Date.diff/2, DateTime.diff/3
Add Date.range/2
Add Date.new/4, DateTime.utc_now/1, NaiveDateTime.new/8 and Time.new/5 that allow specifing calendar
Ensure Calendar.ISO raises a readable error when reaching up the year 10000 restriction
Return {:error, :invalid_time} for wrong precision instead of crashing when parsing ISO dates
Correct typo on Calendar types
Add Date.compare/2, Time.compare/2, NaiveDateTime.compare/2 and DateTime.compare/2
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)
Add Date.leap_year?/1 and Date.day_of_week/1
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
Add Calendar and Date, Time, NaiveDateTime and DateTime types