Skip to content

Releases: elixir-cldr/cldr_dates_times

Cldr Dates Times version 2.20.2

03 Aug 00:30
Compare
Choose a tag to compare

Bug Fixes

  • Return a better error when passing options that are not a keyword list to Cldr.Date.to_string/2, Cldr.Time.to_string/2 and Cldr.DateTime.to_string/2.

Cldr Dates Times version 2.20.0

26 Jul 01:43
Compare
Choose a tag to compare

Bug Fixes

  • Fix Cldr.Time.available_formats/3 when the locale parameter is a binary.

Enhancements

  • Modify the :prefer option of to_string/2 to take a list of preferences. Time formats may sometimes have a :unicode or :ascii preference. Date and datetime formats may have a :default or :variant preference. The :prefer option can now be specified with one or both of these options.

Cldr Dates Times version 2.19.2

08 Jul 18:34
Compare
Choose a tag to compare

Bug Fixes

  • Reinstate Cldr.DateTime.Format.date_formats/3 which was incorrectly removed in version 2.19. Version 2.19 made efforts to improve the symmetry of Cldr.Date, Cldr.Time and Cldr.DateTime. Part of that work is to have each of those modules contain the functions formats/3 and available_formats/3. It was not intended at this time that the equivalent functions be removed from Cldr.DateTime.Format. Thanks to @tjchambers for the report. Closes #51.

Cldr Dates Time version 2.19.1

08 Jul 07:27
Compare
Choose a tag to compare

Bug Fixes

  • Include :skeleton_tokenizer.xrl to the hex package definition.

Cldr Dates Times version 2.19.0

07 Jul 23:12
Compare
Choose a tag to compare

Bug Fixes

  • Fix Cldr.Date.to_string/2 with the option era: :variant to correctly render the variant "AD"/"CE"/"BC"/"BCE" text.

  • Fix Cldr.Date.to_string/2 with the option period: :variant to correctly render the variant "am"/"pm" text.

Enhancements

  • Adds support for partial dates in Cldr.Date.to_string/2. Partial dates are maps with one or more of the fields :year, :month, :day and :calendar.

  • Adds support for partial time in Cldr.Time.to_string/2. Partial times are maps with one or more of the fields :hour, :minute, and :second.

  • Adds support for partial datetimes in Cldr.DateTime.to_string/2. Partial datetimes are maps with one or more of the fields :year, :month, :day, :hour, :minute, :second and :calendar.

  • Adds support for deriving the "best match" format for a date, time or datetime based upon the users requested format or deriving from the available date, time or datetime fields.

  • Adds support for formatting using format IDs (atoms that are keys to locale-independent formats) in Cldr.Date.to_string/2 and Cldr.Time.to_string/2. They have been previously supported in Cldr.DateTime.to_string/2 only.

  • Add MyApp.Cldr.DateTime.Format.common_date_time_format_names/0.

  • Improve the error message if :hour is outside the valid range.

Cldr Dates Times version 2.18.1

01 Jul 14:16
Compare
Choose a tag to compare

Bug Fixes

  • Fix formatting am/pm with format :narrow or :wide. Thanks to @sysashi for the report. Closes #48.

Cldr Dates Times version 2.18.0

29 May 00:56
Compare
Choose a tag to compare

Bug Fixes

  • Clarify format compiler documentation. Thanks to @tjchambers for the issue. Closes #46.

  • Fix typos. Thanks to @tjchambers for the PR. Closes #47.

v2.17.1

01 May 19:01
Compare
Choose a tag to compare

Bug Fixes

  • Add config/prod.exs so that the library can be compiled with MIX_ENV=prod. Thanks to @camelpunch for the PR. Closes #45.

Cldr Dates Times version 2.17.0

20 Apr 22:18
Compare
Choose a tag to compare

Bug Fixes

  • Fix formatting with formats that have may have pluralization like the :MMMMW and :yw formats.

  • Fix :underspecs for dialyzer.

Enhancements

  • Update to CLDR 45.0 data.

  • Adds support for formats that have both unicode whitespace and ascii whitespace versions. The option :prefer is added to Cldr.DateTime.to_string/3. The default is prefer: :unicode. The option prefer: :ascii is included for backwards compatibility of older applications. The formats that provide both :unicode and :ascii versions can be seen from the results of Cldr.DateTime.Format.date_time_available_formats/2.

Cldr Dates Times version 2.16.0

02 Nov 09:49
Compare
Choose a tag to compare

Bug Fixes

  • Fix formatting time intervals when the to time is not greater than the from time. This allows time intervals that cross midnight to be formatted correctly. Thanks to @larshei for the report. Closes #42.

  • Fix compiler warnings on Elixir 1.16.

Enhancements

  • Adds options :date_format and :time_format to Cldr.DateTime.Interval.to_string/2 and Cldr.DateTime.to_string/2. These options allow separate formatting of the date and time parts of a datetime, including those that are part of an interval. Thanks to @jmoldrich for the report (and patience). Closes #33.