Changelog for Cldr_Dates_Times v2.6.0
This is the changelog for Cldr_Dates_Times v2.6.0 released on November 1st, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Add support for CLDR 38
Changelog for Cldr_Dates_Times v2.5.4
This is the changelog for Cldr_Dates_Times v2.5.4 released on September 26th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Use
Cldr.Date.default_backend/0as a shim to provide compatibility for the upcomingex_cldrversion2.18.0whereCldr.default_backend/0is deprecated in favour ofCldr.default_backend!/0
Changelog for Cldr_Dates_Times v2.5.3
This is the changelog for Cldr_Dates_Times v2.5.3 released on September 22nd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix compiler warns on duplicate
@docon Elixir 1.11
Changelog for Cldr_Dates_Times v2.5.2
This is the changelog for Cldr_Dates_Times v2.5.2 released on September 2nd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Correct the spec for Cldr.DateTime.Relative.to_string!/3. Thanks to @loskobrakai.
Changelog for Cldr_Dates_Times v2.5.1
This is the changelog for Cldr_Dates_Times v2.5.1 released on June 17th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
Use locale's number system if no optional number system is provided. Fixes
Cldr.Date,Cldr.TimeandCldr.DateTimeFix datetime formatting for
CalendarIntervals that have minute precision. In these cases,:secondsand:microsecondsshould be zeroed.Fix links to
hex.pmforcalendar_interval
Changelog for Cldr_Dates_Times v2.5.0
This is the changelog for Cldr_Dates_Times v2.5.0 released on June 13th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
Add localized interval formatting with
Cldr.Interval.to_string/3and specific implementations inCldr.Date.Interval.to_string/3,Cldr.Time.Interval.to_string/3andCldr.DateTime.to_string/3Add
<backend>.Interval.to_string/3,<backend>.Date.Interval.to_string/3,<backend>.Time.Interval.to_string/3,<backend>.DateTime.Interval.to_string/3Add
:precompiled_interval_formatsdefined in the backend configuration
Bug Fixes
Correct doc examples in README.md. Thanks to @tcitworld. Closes #13.
Fix options processing for
:styleand:formatforCldr.Date.to_string/3,Cldr.DateTime.to_string/3andCldr.Time.to_string/3.:formatis preferred although:styleis honoured.Fix transliteration to other number systems
Retrieve
:precompiled_date_time_formatsfrom the backend configuration, not the global configuration
Changelog for Cldr_Dates_Times v2.4.0
This is the changelog for Cldr_Dates_Times v2.4.0 released on May 4th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
Add
Cldr.Time.hour_format_from_locale/1to return the hour formatted preferred for a localeAdd
Cldr.DateTime.Formatter.hour/{2, 4}that formats the hour part of a time in accordance with locale preferences (including honouring thehckey of theulanguage tag extension)Add format symbol
dddto return the day of the month with ordinal formatting. This not a CLDR standard format symbol.Add protocol support for
Cldr.Charswhich is used byCldr.to_string/1
Changelog for Cldr_Dates_Times v2.3.0
This is the changelog for Cldr_Dates_Times v2.3.0 released on February 2nd, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Adds backend modules
MyApp.Cldr.Date,MyApp.Cldr.TimeandMyApp.Cldr.DateTimethat contain the functionsto_string/2andto_string!/2. This means all theex_cldrfamily of libraries should now be primarily called on the backend modules. This makes aliasing easier too. For example:
defmodule MyApp.Cldr do
use Cldr, providers: [Cldr.Number, Cldr.DateTime], default_locale: "en"
end
defmodule MyApp do
alias MyApp.Cldr
def some_fun do
Cldr.Date.to_string Date.utc_today()
end
endChangelog for Cldr_Dates_Times v2.2.4
This is the changelog for Cldr_Dates_Times v2.2.4 released on January 14th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
Update tests for Elixir 1.10 date/time inspection changes
Fix dialyzer warning in generated backend
Changelog for Cldr_Dates_Times v2.2.3
This is the changelog for Cldr_Dates_Times v2.2.3 released on September 14th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Correctly uses a provided
:backendoption when validating the:localeoption to the variousto_string/3calls. Thanks to @lostkobrakai. Closes #108 and #109.
Changelog for Cldr_Dates_Times v2.2.2
This is the changelog for Cldr_Dates_Times v2.2.2 released on August 31st, 2019. For older changelogs please consult the release tag on GitHub
Changes & Deprecations
- Deprecates the option
:formatonCldr.DateTime.Relative.to_string/3in favour of:style.:formatwill be removed withex_cldr_dates_timesversion 3.0
Bug Fixes
- Return an error tuple immediately when a format code is used but no data is available to fulfill it
Changelog for Cldr_Dates_Times v2.2.1
This is the changelog for Cldr_Dates_Times v2.2.1 released on August 23rd, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix
@specforCldr.Date.to_string/3,Cldr.Time.to_string/3andCldr.DateTime.to_string/3as well as the!variants.
Changelog for Cldr_Dates_Times v2.2.0
This is the changelog for Cldr_Dates_Times v2.2.0 released on August 23rd, 2019. For older changelogs please consult the release tag on GitHub
Breaking change
- Support Elixir 1.8 and later only since this package depends on ex_cldr_calendars which requires Elixir 1.8.
Bug Fixes
Fix references to
Cldr.get_current_locale/0to the currentCldr.get_locale/0Fix dialyzer warnings
Changelog for Cldr_Dates_Times v2.1.0
This is the changelog for Cldr_Dates_Times v2.1.0 released on June 16th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
All calling
Date,TimeandDateTimeto_string/3asto_string/1omitting the backend and providing options. The backend will default toCldr.default_backend(). An exception will be raised if there is no default backend.Updates to ex_cldr_calendars 1.0 which includes
Cldr.Calendar.week_of_month/1. The result corresponds to theWformat which is now implemented as well.
Changelog for Cldr_Dates_Times v2.0.2
This is the changelog for Cldr_Dates_Times v2.0.2 released on June 12th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Resolve the actual number system before transliterating a date, time or datetime. Closes #9. Thanks to @ribanez7 for the report.
Changelog for Cldr_Dates_Times v2.0.1
This is the changelog for Cldr_Dates_Times v2.0.1 released on June 9th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes a formatter code generation error when a format is a tuple form not a string form.
Changelog for Cldr_Dates_Times v2.0.0
This is the changelog for Cldr_Dates_Times v2.0 released on June 9th, 2019. For older changelogs please consult the release tag on GitHub
This release depends on ex_cldr_calendars which provides the underlying calendar calculations as well as providing a set of additional calendars.
Breaking Changes
ex_cldr_dates_timesrequires a minimum Elixir version of 1.8. It depends onCalendarcapabilities built into this and later release.ex_cldr_dates_timesnow depends upon ex_cldr version 2.0. As a result it is a requirement that at least one backend module be configured as described in the ex_cldr readme.The public API is now based upon functions defined on a backend module. Therefore calls to functions such as
Cldr.DateTime.to_string/3should be replaced with calls toMyApp.Cldr.DateTime.to_string/3(assuming your configured backend module is calledMyApp.Cldr).
Enhancements
Correctly calculates
week_of_yearSupports
Calendar.ISOand any calendar defined withCldr.Calendar(see ex_cldr_calendars)
Known limitations
- Does not calculate
week_of_month. If called will return1for all input values.
Migration
ex_cldr_dates_times uses the configuration set for the dependency ex_cldr. See the documentation for ex_cldr
Unlike ex_cldr_dates_times version 1, version 2 requires one or more backend modules to host the functions that manage CLDR data. An example to get started is:
- Create a backend module:
defmodule MyApp.Cldr do
use Cldr,
locales: ["en", "fr", "ja"],
providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime]
end- Update
config.exsconfiguration to specify this backend as the system default:
config :ex_cldr,
default_locale: "en",
default_backend: MyApp.Cldr