Changelog
View SourceNote that ex_cldr_dates_times version 2.18.0 and later are supported on Elixir 1.12 and later only.
Cldr_Dates_Times v2.24.2
This is the changelog for Cldr_Dates_Times v2.24.2 released on October 14th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix generated doc links in generated backend modules. Previously they used implicit links to the projects README file. Since they generate code, the implicit links end up referencing the users project README which is not the intention and which generates
ex_docwarnings. Thanks to @zorn for the report. Fixes #63 for this library.
Cldr_Dates_Times v2.24.1
This is the changelog for Cldr_Dates_Times v2.24.1 released on October 9th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Allow
NaiveDatetime.t/0types to be passed toCldr.Interval.to_string/3. Previously there was no function clause that supported these types even though the formatting code does. Thanks to @sysashi for the report. Partially fixes #62. Full resolution requires fixing #61 targetted for the end of October 2025.
Cldr_Dates_Times v2.24.0
This is the changelog for Cldr_Dates_Times v2.24.0 released on September 11th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
Remove unused dependencies from
mix.lock. Thanks to @Munksgaard. Closes #60.Fix missing backticks in docs. Thanks to @Munksgaard. Closes #58.
Enhancements
- Adds
Cldr.DateTime.Timezone.locations_with_zone_changes/0that returns a list of locations which have changed time zone over time.
Cldr_Dates_Times v2.23.0
This is the changelog for Cldr_Dates_Times v2.23.0 released on August 27th, 2025. For older changelogs please consult the release tag on GitHub
Breaking change to S format code implementation
This release fixes a long-standing bug in the formatting of the S (fractional second) format code. Any applications relying on the previous incorrect implementation will need updating.
Bug Fixes
- Fixes formatting of the
Sformat code which formats fractional seconds. In previous versions,Swas formatted to include both the number of seconds and the fraction of a second. This is incorrect according to TR 35. Now theSformats only the fraction of a second. In addition, the fraction of a second is truncated (previously rounded) and right-filled with0characters if required. See also the formatter documentation for further information. Thanks to @jswanner for the report. Closes #55.
Enhancements
Adds support for localized time zone names in
Cldr.DateTime.Timezone. This module supports formatting of a time zone in the following formats:- Generic non-location format
- Generic partial location format
- Generic location format
- Specific non-location format
- Specific location format
- Localized GMT format
Adds
Cldr.DateTime.Timezone.preferred_zone_for_locale/2to return the preferred time zone name for a given zone and locale. This function is useful when the same time zone has different names in different locales. For example:
iex> Cldr.DateTime.Timezone.preferred_zone_for_locale("America/New_York", locale: "en")
{:ok, "America/New_York"}
iex> Cldr.DateTime.Timezone.preferred_zone_for_locale("America/New_York", locale: "en-CA")
{:ok, "America/Toronto"}Implements user-specified relative time steps as the
:derive_unit_fromoption toCldr.DateTime.Relative.to_string/3function. This allows developers to specify when a relative time interval steps from seconds to minutes to days and so on. Thanks to @tjchambers for the collaboration and patience. Closes #54.Adds functions to return a specific format string for time, date and datetime. Thanks to @tjchambers for the collaboration. Closes #57. See:
Adds support for
Time.t/0arguments toCldr.DateTime.Relative.to_string/3.
Cldr_Dates_Times v2.22.0
This is the changelog for Cldr_Dates_Times v2.22.0 released on March 18th, 2025. For older changelogs please consult the release tag on GitHub
Breaking Data format changes
There are some changes to the underlying locale data format that will be a breaking change for results returned from:
Cldr.DateTime.Format.time_formats/{1,2,3}MyApp.Cldr.Calendar.day_periods/{0, 1, 2}
The data changes are summarised as:
- Time formats now group the
:defaultand:asciialternatives. - Day periods used for date/time formatting now group the alternatives for
amandpmwhere the data is available. - Day period display names now group the alternatives for
amandpmwhere the data is available.
Enhancements
- Update to CLDR 47 data.
Cldr_Dates_Times v2.21.0
This is the changelog for Cldr_Dates_Times v2.21.0 released on January 31st, 2025. For older changelogs please consult the release tag on GitHub
Enhancements
- Allow configuration of
ex_cldr_calendarsversion 2.0 and later.
Cldr_Dates_Times v2.20.3
This is the changelog for Cldr_Dates_Times v2.20.3 released on August 17th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix specs to pass with a broader range of dialyzer options.
Cldr_Dates_Times v2.20.2
This is the changelog for Cldr_Dates_Times v2.20.2 released on August 3rd, 2024. For older changelogs please consult the release tag on GitHub
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/2andCldr.DateTime.to_string/2.
Cldr_Dates_Times v2.20.1
This is the changelog for Cldr_Dates_Times v2.20.1 released on July 27th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Supports formatting
Cldr.Calendar.Duration.t/0and, on Elixir 1.17 or later,Duration.t/0structs. For these structs, and only these structs, the:hourcan be any number. In other cases the number is required to be in the range0..24.
Cldr_Dates_Times v2.20.0
This is the changelog for Cldr_Dates_Times v2.20.0 released on July 26th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix
Cldr.Time.available_formats/3when the locale parameter is a binary.
Enhancements
- Modify the
:preferoption ofto_string/2to take a list of preferences. Time formats may sometimes have a:unicodeor:asciipreference. Date and datetime formats may have a:defaultor:variantpreference. The:preferoption can now be specified with one or both of these options.
Cldr_Dates_Times v2.19.2
This is the changelog for Cldr_Dates_Times v2.19.2 released on July 9th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Reinstate
Cldr.DateTime.Format.date_formats/3which was incorrectly removed in version 2.19. Version 2.19 made efforts to improve the symmetry ofCldr.Date,Cldr.TimeandCldr.DateTime. Part of that work is to have each of those modules contain the functionsformats/3andavailable_formats/3. It was not intended at this time that the equivalent functions be removed fromCldr.DateTime.Format. Thanks to @tjchambers for the report. Closes #51.
Cldr_Dates_Times v2.19.1
This is the changelog for Cldr_Dates_Times v2.19.1 released on July 8th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Include
:skeleton_tokenizer.xrlto the hex package definition.
Cldr_Dates_Times v2.19.0
This is the changelog for Cldr_Dates_Times v2.19.0 released on July 8th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
Fix
Cldr.Date.to_string/2with the optionera: :variantto correctly render the variant "AD"/"CE"/"BC"/"BCE" text.Fix
Cldr.Date.to_string/2with the optionperiod: :variantto 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,:dayand: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,:secondand: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/2andCldr.Time.to_string/2. They have been previously supported inCldr.DateTime.to_string/2only.Add
MyApp.Cldr.DateTime.Format.common_date_time_format_names/0.Improve the error message if
:houris outside the valid range.
Cldr_Dates_Times v2.18.1
This is the changelog for Cldr_Dates_Times v2.18.1 released on July 1st, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting
am/pmwith format:narrowor:wide. Thanks to @sysashi for the report. Closes #48.
Cldr_Dates_Times v2.18.0
This is the changelog for Cldr_Dates_Times v2.18.0 released on May 29th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
Clarify format compiler documentation. Thanks to @tjchambers for the issue. Closes #46.
Fix typos. Thanks to @tjchambers for the PR. Closes #47.
Cldr_Dates_Times v2.17.1
This is the changelog for Cldr_Dates_Times v2.17.1 released on May 2nd, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Add
config/prod.exsso that the library can be compiled withMIX_ENV=prod. Thanks to @camelpunch for the PR. Closes #45.
Cldr_Dates_Times v2.17.0
This is the changelog for Cldr_Dates_Times v2.17.0 released on April 21st, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
Fix formatting with formats that have may have pluralization like the
:MMMMWand:ywformats.Fix
:underspecsfor dialyzer.
Enhancements
Update to CLDR 45.0 data.
Adds support for formats that have both unicode whitespace and ascii whitespace versions. The option
:preferis added toCldr.DateTime.to_string/3. The default isprefer: :unicode. The optionprefer: :asciiis included for backwards compatibility of older applications. The formats that provide both:unicodeand:asciiversions can be seen from the results ofCldr.DateTime.Format.date_time_available_formats/2.
Cldr_Dates_Times v2.16.0
This is the changelog for Cldr_Dates_Times v2.16.0 released on November 2nd, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
Fix formatting time intervals when the
totime is not greater than thefromtime. 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_formatand:time_formattoCldr.DateTime.Interval.to_string/2andCldr.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.
Cldr_Dates_Times v2.15.0
This is the changelog for Cldr_Dates_Times v2.15.0 released on October 17th, 2023. For older changelogs please consult the release tag on GitHub
Deprecations
- The support of
:styleas a synonym for:formatwith the functionsCldr.Time.to_string/2,Cldr.Date.to_string/2andCldr.DateTime.to_string/2is now removed. The:styleoption is now used to influence the use of "at" formats inCldr.DateTime.to_string/2.:stylealso remains a valid option for interval formatting.
Enhancements
- Add support for "at" style formatting for
DateTimestructs. This style is documented in TR35 and was introduced in CLDR 43. Thanks to @jueberschlag for the report and motivation to get this done.
Cldr_Dates_Times v2.14.3
This is the changelog for Cldr_Dates_Times v2.14.3 released on October 10th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting date intervals with
:month_and_daystyle when the last date is in a different year to the first. Thanks to @matt-glover for the report. Closes #40.
Cldr_Dates_Times v2.14.2
This is the changelog for Cldr_Dates_Times v2.14.2 released on September 24th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix additional typespecs for various functions that allow a string-based locale identifier. Thanks to @jarrodmoldrich for the report.
Cldr_Dates_Times v2.14.1
This is the changelog for Cldr_Dates_Times v2.14.1 released on September 23rd, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix typespecs for various functions that allow a string-based locale identifier. Thanks to @jarrodmoldrich for the report. Closes #39.
Cldr_Dates_Times v2.14.0
This is the changelog for Cldr_Dates_Times v2.14.0 released on August 17th, 2023. For older changelogs please consult the release tag on GitHub
Enhancements
Updates to ex_cldr version 2.37.0 which includes data from CLDR release 43
Adds an option
:wrappertoCldr.DateTime.to_string/2,Cldr.Date.to_string/2andCldr.Time.to_string/2. The argument is a 2-arity function that receives the parametersstringandtagwheretagis an atom denoting the time unit being formatted (for example,:minuteor:yearor:literal). The function must return either iodata or a "safe string" such as that returned byPhoenix.HTML.Tag.content_tag/3. The function can be used to wrap format elements in HTML or other tags.
Cldr_Dates_Times v2.13.3
This is the changelog for Cldr_Dates_Times v2.13.3 released on March 13th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
This release requires (and configures) ex_cldr version 2.36.0 or later. That version fixes the interval format data so that formats required by locales that use 24-hour times are not overwritten by data for 12-hour formats. As a result, formatting intervals using a format key directly (ie one of the keys in the map returned by MyApp.Cldr.DateTime.Format.date_time_interval_formats/1) may find the key has changed.
- Fixes localised time interval formatting to respect the locale's preference for 12-hour or 24-hour times. Thanks to @Gladear for the report and collaboration. Closes #35.
Cldr_Dates_Times v2.13.2
This is the changelog for Cldr_Dates_Times v2.13.2 released on March 12th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
Fixed interval formats when the format provided is a string (rather than the normal atom-based predefined formats)
Fixed setting the number system from options (typographical error)
Removed spurious
IO.inspect/2output when the format is a string.
Cldr_Dates_Times v2.13.1
This is the changelog for Cldr_Dates_Times v2.13.1 released on November 12th, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes doc generation errors (no functional changes to executing code). Closes #34. THanks to @sax for the report and the PR.
Cldr_Dates_Times v2.13.0
This is the changelog for Cldr_Dates_Times v2.13.0 released on October 19th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to CLDR 42. The data time formats for several locales have changed from "<date> at <time>" to "<date>, <time>". This is a new category of formats that retain the
atformats but these are not yet exposed inex_cldr_dates_times.
Cldr_Dates_Times v2.12.0
This is the changelog for Cldr_Dates_Times v2.12.0 released on May 7th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Makes
Cldr.Date.Interval.greatest_difference/2to be part of the public API. Also addsCldr.DateTime.Interval.greatest_difference/2andCldr.Time.Interval.greatest_difference/2.
Cldr_Dates_Times v2.11.0
This is the changelog for Cldr_Dates_Times v2.11.0 released on February 21st, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to ex_cldr version 2.26.0 and ex_cldr_numbers version 2.25.0 which use atoms for locale names and rbnf locale names. This is consistent with other elements of
t:Cldr.LanguageTagwhere atoms are used when the cardinality of the data is fixed and relatively small and strings where the data is free format.
Cldr_Dates_Times v2.10.2
This is the changelog for Cldr_Dates_Times v2.10.2 released on January 15th, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix
Date.to_string/2when the second argument is a list of options and not a backend module. Previously this would ignore any:backendoption and try to useCldr.default_backend!/0which would fail if not one was configured. The same fix is applied toCldr.Time.to_string/2andCldr.DateTime.to_string/2.
Cldr_Dates_Times v2.10.1
This is the changelog for Cldr_Dates_Times v2.10.1 released on December 1st, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
Replace
use Mix.Configwithimport Configin config filesCorrectly call
transliterate_digits/3nottransliterate/3when transliterating digits for date/time formats
Cldr_Dates_Times v2.10.0
This is the changelog for Cldr_Dates_Times v2.10.0 released on October 27th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
Improved localization in support of Chinese, Japanese and Korea calendars (era, month names, cyclic year, related gregorian year)
Updates to support CLDR release 40 via ex_cldr version 2.24
Bug Fixes
- Fix year formatting to account for different calendar resolvers
Deprecations
Don't call deprecated
Cldr.Config.get_locale/2, useCldr.Locale.Loader.get_config/2instead.Don't call deprecated
Cldr.Config.known_locale_names/1, callCldr.Locale.Loader.known_locale_names/1instead.
Cldr_Dates_Times v2.10.0-rc.3
This is the changelog for Cldr_Dates_Times v2.10.0-rc.3 released on October 25th, 2021. For older changelogs please consult the release tag on GitHub
Deprecations
- Don't call deprecated
Cldr.Config.known_locale_names/1, callCldr.Locale.Loader.known_locale_names/1instead.
Cldr_Dates_Times v2.10.0-rc.2
This is the changelog for Cldr_Dates_Times v2.10.0-rc.2 released on October 25th, 2021. For older changelogs please consult the release tag on GitHub
Deprecations
- Don't call deprecated
Cldr.Config.get_locale/2, useCldr.Locale.Loader.get_config/2instead.
Cldr_Dates_Times v2.10.0-rc.1
This is the changelog for Cldr_Dates_Times v2.10.0-rc.1 released on October 21st, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix year formatting to account for different calendar resolvers
Cldr_Dates_Times v2.10.0-rc.0
This is the changelog for Cldr_Dates_Times v2.10.0-rc.0 released on October 20th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
Improved localization in support of Chinese, Japanese and Korea calendars (era, month names, cyclic year, related gregorian year)
Update to
ex_cldrversion2.24which uses CLDR 40 data
Cldr_Dates_Times v2.9.4
This is the changelog for Cldr_Dates_Times v2.9.4 released on September 22nd, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
- Fixes relative date and date time formatting when a
:relative_toparameter and no:unitparameter is specified. Thanks to @maennchen for the report. Closes #26.
Cldr_Dates_Times v2.9.3
This is the changelog for Cldr_Dates_Times v2.9.3 released on September 20th, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
- Fixes relative date and date time formatting when a
:relative_toparameter and a:unitparameter is specified. Thanks to @DaTrader for the report. Closes #25.
Cldr_Dates_Times v2.9.2
This is the changelog for Cldr_Dates_Times v2.9.2 released on August 14th, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
Open interval formats can now also be called directly on the backend. For example:
iex> MyApp.Cldr.Date.Interval.to_string ~D[2020-01-01], nil {:ok, "Jan 1, 2020 –"}
Cldr_Dates_Times v2.9.1
This is the changelog for Cldr_Dates_Times v2.9.1 released on August 14th, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
- When formatting an open interval (one side is
nil) the backend functiondate_time_interval_fallback/2is used to retrieve the format pattern. Previously this function was being called with default parameters. Now it is properly called with a locale and a calendar.
Cldr_Dates_Times v2.9.0
This is the changelog for Cldr_Dates_Times v2.9.0 released on August 14th, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
- Fix splitting interval formats when there is no repeating field. Use the principal that standalone formats are equivalent to normal formats when splitting. ie, for this purposes "L" == "M". This means the locale "fa" no longer raises an exception.
Enhancements
- Allow formatting of intervals where one side is
nil. This will produce an open-ended interval. Only one side of the interval can benil. Thanks to @woylie for the request. Closes #23.
Examples
iex> Cldr.Date.Interval.to_string ~D[2020-01-01], nil, MyApp.Cldr,
...> format: :short
{:ok, "1/1/20 –"}
iex> Cldr.Time.Interval.to_string ~U[2020-01-01 00:00:00.0Z], nil, MyApp.Cldr,
...> format: :long, style: :flex
{:ok, "12:00:00 AM UTC –"}
iex> Cldr.DateTime.Interval.to_string ~U[2020-01-01 00:00:00.0Z], nil, MyApp.Cldr
{:ok, "Jan 1, 2020, 12:00:00 AM –"}Cldr_Dates_Times v2.8.0
This is the changelog for Cldr_Dates_Times v2.8.0 released on July 1st, 2021. For older changelogs please consult the release tag on GitHub
Bug fixes
- Fixes formatting time intervals that by checking for a format key of
:hin addition to the:aand:bformat keys (similar to issue #22).
Enhancements
- Updated to ex_cldr version 2.23.0 which changes the names of some of the field in the "-u-" extension to match the CLDR canonical name. In particular the field name
hour_cyclechanges tohc. The values forhcalso change to the canonical forms of:h12,:h11,:h23and:h24.
Cldr_Dates_Times v2.7.2
This is the changelog for Cldr_Dates_Times v2.7.2 released on May 6th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix regression time intervals where the start time is "a.m." and the end time is "p.m." and the format code is
:b(previously assumed:a). Thanks to @bryanlep for the report. Closes #22.
Cldr_Dates_Times v2.7.1
This is the changelog for Cldr_Dates_Times v2.7.1 released on May 6th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting time intervals where the start time is "a.m." and the end time is "p.m.". Thanks to @sfusato for the report. Closes #21.
Cldr_Dates_Times v2.7.0
This is the changelog for Cldr_Dates_Times v2.7.0 released on April 8th, 2021. For older changelogs please consult the release tag on GitHub
Data changes
- Some date and time formats have changed for some locales. This applies to interval date, time and datetime formats in
enlocale for example. Some time formats have also now changed inenfrom 24-hour times toam/pmformats.
Enhancements
- Add support for CLDR 39
Cldr_Dates_Times v2.7.0-rc.0
This is the changelog for Cldr_Dates_Times v2.7.0-rc.0 released on March 19th, 2021. For older changelogs please consult the release tag on GitHub
Data changes
- Some date and time formats have changed for some locales. This applies to interval date, time and datetime formats in
enlocale for example. Some time formats have also now changed inenfrom 24-hour times toam/pmformats.
Enhancements
- Add support for CLDR 39
Cldr_Dates_Times v2.6.4
This is the changelog for Cldr_Dates_Times v2.6.4 released on December 17th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
Remove
xrefsection from the project inmix.exs. The fixes an error where the configuration forxrefwas incorrect and causing compiler errors on some versions of Elixir. Closes #19. Thanks to @fertapric.Make dependencies
eprofanddialyixiroptional so that they aren't dragged into host apps unnecessarily.
Cldr_Dates_Times v2.6.3
This is the changelog for Cldr_Dates_Times v2.6.3 released on December 3rd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- [UPDATED] Fix regression whereby formatting a Date or Time via a backend with no options would raise a
Cldr.NoDefaultBackendError (No default :ex_cldr backend is configured)exception. Closes #18 properly. Thanks to @maennchen.
Cldr_Dates_Times v2.6.2
This is the changelog for Cldr_Dates_Times v2.6.2 released on December 2nd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix regression whereby formatting a DateTime via a backend with no options would raise a
Cldr.NoDefaultBackendError (No default :ex_cldr backend is configured)exception. Closes #18. Thanks to @maennchen.
Cldr_Dates_Times v2.6.1
This is the changelog for Cldr_Dates_Times v2.6.1 released on November 30th, 2020. For older changelogs please consult the release tag on GitHub
Performance improvements
Don't transliterate when the number system is
:latn(which it most commonly is). The improves formatting performance by about 40%.Handle default parameters more efficiently which improves performance by a further 10%.
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
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
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
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.
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
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
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
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
endCldr_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
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.
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
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.
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
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.
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.
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.
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