View Source Changelog
cldr_dates_times-v2-12-0
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
Enhancements
- Makes
Cldr.Date.Interval.greatest_difference/2
to be part of the public API. Also addsCldr.DateTime.Interval.greatest_difference/2
andCldr.Time.Interval.greatest_difference/2
.
cldr_dates_times-v2-11-0
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-1
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.LanguageTag
where 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
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
Bug Fixes
- Fix
Date.to_string/2
when the second argument is a list of options and not a backend module. Previously this would ignore any:backend
option and try to useCldr.default_backend!/0
which would fail if not one was configured. The same fix is applied toCldr.Time.to_string/2
andCldr.DateTime.to_string/2
.
cldr_dates_times-v2-10-1
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-1
Bug Fixes
Replace
use Mix.Config
withimport Config
in config filesCorrectly call
transliterate_digits/3
nottransliterate/3
when transliterating digits for date/time formats
cldr_dates_times-v2-10-0
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-2
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-2
Bug Fixes
- Fix year formatting to account for different calendar resolvers
deprecations
Deprecations
Don't call deprecated
Cldr.Config.get_locale/2
, useCldr.Locale.Loader.get_config/2
instead.Don't call deprecated
Cldr.Config.known_locale_names/1
, callCldr.Locale.Loader.known_locale_names/1
instead.
cldr_dates_times-v2-10-0-rc-3
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-1
Deprecations
- Don't call deprecated
Cldr.Config.known_locale_names/1
, callCldr.Locale.Loader.known_locale_names/1
instead.
cldr_dates_times-v2-10-0-rc-2
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-2
Deprecations
- Don't call deprecated
Cldr.Config.get_locale/2
, useCldr.Locale.Loader.get_config/2
instead.
cldr_dates_times-v2-10-0-rc-1
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-3
Bug Fixes
- Fix year formatting to account for different calendar resolvers
cldr_dates_times-v2-10-0-rc-0
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-3
Enhancements
Improved localization in support of Chinese, Japanese and Korea calendars (era, month names, cyclic year, related gregorian year)
Update to
ex_cldr
version2.24
which uses CLDR 40 data
cldr_dates_times-v2-9-4
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-4
Bug fixes
- Fixes relative date and date time formatting when a
:relative_to
parameter and no:unit
parameter is specified. Thanks to @maennchen for the report. Closes #26.
cldr_dates_times-v2-9-3
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-5
Bug fixes
- Fixes relative date and date time formatting when a
:relative_to
parameter and a:unit
parameter is specified. Thanks to @DaTrader for the report. Closes #25.
cldr_dates_times-v2-9-2
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-6
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
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-7
Bug fixes
- When formatting an open interval (one side is
nil
) the backend functiondate_time_interval_fallback/2
is 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
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-8
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-4
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
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-9
Bug fixes
- Fixes formatting time intervals that by checking for a format key of
:h
in addition to the:a
and:b
format keys (similar to issue #22).
enhancements-5
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_cycle
changes tohc
. The values forhc
also change to the canonical forms of:h12
,:h11
,:h23
and:h24
.
cldr_dates_times-v2-7-2
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-10
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
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-11
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
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
Data changes
- Some date and time formats have changed for some locales. This applies to interval date, time and datetime formats in
en
locale for example. Some time formats have also now changed inen
from 24-hour times toam/pm
formats.
enhancements-6
Enhancements
- Add support for CLDR 39
cldr_dates_times-v2-7-0-rc-0
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-1
Data changes
- Some date and time formats have changed for some locales. This applies to interval date, time and datetime formats in
en
locale for example. Some time formats have also now changed inen
from 24-hour times toam/pm
formats.
enhancements-7
Enhancements
- Add support for CLDR 39
cldr_dates_times-v2-6-4
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-12
Bug Fixes
Remove
xref
section from the project inmix.exs
. The fixes an error where the configuration forxref
was incorrect and causing compiler errors on some versions of Elixir. Closes #19. Thanks to @fertapric.Make dependencies
eprof
anddialyixir
optional so that they aren't dragged into host apps unnecessarily.
cldr_dates_times-v2-6-3
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-13
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
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-14
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
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
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
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-8
Enhancements
- Add support for CLDR 38
cldr_dates_times-v2-5-4
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-15
Bug Fixes
- Use
Cldr.Date.default_backend/0
as a shim to provide compatibility for the upcomingex_cldr
version2.18.0
whereCldr.default_backend/0
is deprecated in favour ofCldr.default_backend!/0
cldr_dates_times-v2-5-3
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-16
Bug Fixes
- Fix compiler warns on duplicate
@doc
on Elixir 1.11
cldr_dates_times-v2-5-2
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-17
Bug Fixes
- Correct the spec for Cldr.DateTime.Relative.to_string!/3. Thanks to @loskobrakai.
cldr_dates_times-v2-5-1
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-18
Bug Fixes
Use locale's number system if no optional number system is provided. Fixes
Cldr.Date
,Cldr.Time
andCldr.DateTime
Fix datetime formatting for
CalendarInterval
s that have minute precision. In these cases,:seconds
and:microseconds
should be zeroed.Fix links to
hex.pm
forcalendar_interval
cldr_dates_times-v2-5-0
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-9
Enhancements
Add localized interval formatting with
Cldr.Interval.to_string/3
and specific implementations inCldr.Date.Interval.to_string/3
,Cldr.Time.Interval.to_string/3
andCldr.DateTime.to_string/3
Add
<backend>.Interval.to_string/3
,<backend>.Date.Interval.to_string/3
,<backend>.Time.Interval.to_string/3
,<backend>.DateTime.Interval.to_string/3
Add
:precompiled_interval_formats
defined in the backend configuration
bug-fixes-19
Bug Fixes
Correct doc examples in README.md. Thanks to @tcitworld. Closes #13.
Fix options processing for
:style
and:format
forCldr.Date.to_string/3
,Cldr.DateTime.to_string/3
andCldr.Time.to_string/3
.:format
is preferred although:style
is honoured.Fix transliteration to other number systems
Retrieve
:precompiled_date_time_formats
from the backend configuration, not the global configuration
cldr_dates_times-v2-4-0
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-10
Enhancements
Add
Cldr.Time.hour_format_from_locale/1
to 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 thehc
key of theu
language tag extension)Add format symbol
ddd
to return the day of the month with ordinal formatting. This not a CLDR standard format symbol.Add protocol support for
Cldr.Chars
which is used byCldr.to_string/1
cldr_dates_times-v2-3-0
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-11
Enhancements
- Adds backend modules
MyApp.Cldr.Date
,MyApp.Cldr.Time
andMyApp.Cldr.DateTime
that contain the functionsto_string/2
andto_string!/2
. This means all theex_cldr
family 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
end
cldr_dates_times-v2-2-4
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-20
Bug Fixes
Update tests for Elixir 1.10 date/time inspection changes
Fix dialyzer warning in generated backend
cldr_dates_times-v2-2-3
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-21
Bug Fixes
- Correctly uses a provided
:backend
option when validating the:locale
option to the variousto_string/3
calls. Thanks to @lostkobrakai. Closes #108 and #109.
cldr_dates_times-v2-2-2
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
Changes & Deprecations
- Deprecates the option
:format
onCldr.DateTime.Relative.to_string/3
in favour of:style
.:format
will be removed withex_cldr_dates_times
version 3.0
bug-fixes-22
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
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-23
Bug Fixes
- Fix
@spec
forCldr.Date.to_string/3
,Cldr.Time.to_string/3
andCldr.DateTime.to_string/3
as well as the!
variants.
cldr_dates_times-v2-2-0
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
Breaking change
- Support Elixir 1.8 and later only since this package depends on ex_cldr_calendars which requires Elixir 1.8.
bug-fixes-24
Bug Fixes
Fix references to
Cldr.get_current_locale/0
to the currentCldr.get_locale/0
Fix dialyzer warnings
cldr_dates_times-v2-1-0
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-12
Enhancements
All calling
Date
,Time
andDateTime
to_string/3
asto_string/1
omitting 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 theW
format which is now implemented as well.
cldr_dates_times-v2-0-2
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-25
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
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-26
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
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
Breaking Changes
ex_cldr_dates_times
requires a minimum Elixir version of 1.8. It depends onCalendar
capabilities built into this and later release.ex_cldr_dates_times
now 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/3
should be replaced with calls toMyApp.Cldr.DateTime.to_string/3
(assuming your configured backend module is calledMyApp.Cldr
).
enhancements-13
Enhancements
Correctly calculates
week_of_year
Supports
Calendar.ISO
and any calendar defined withCldr.Calendar
(see ex_cldr_calendars)
known-limitations
Known limitations
- Does not calculate
week_of_month
. If called will return1
for all input values.
migration
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.exs
configuration to specify this backend as the system default:
config :ex_cldr,
default_locale: "en",
default_backend: MyApp.Cldr