Skip to content

Releases: elixir-cldr/cldr_dates_times

Cldr Dates Times version 2.3.0

02 Feb 14:58
Compare
Choose a tag to compare

Enhancements

  • Adds backend modules MyApp.Cldr.Date, MyApp.Cldr.Time and MyApp.Cldr.DateTime that contain the functions to_string/2 and to_string!/2. This means all the ex_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 version 2.2.4

14 Jan 09:48
Compare
Choose a tag to compare

Bug Fixes

  • Update tests for Elixir 1.10 date/time inspection changes

  • Fix dialyzer warning in generated backend

Cldr Dates Times version 2.2.3

14 Sep 19:48
Compare
Choose a tag to compare

Bug Fixes

  • Correctly uses a provided :backend option when validating the :locale option to the various to_string/3 calls. Thanks to @LostKobrakai. Closes #108 and #109.

Cldr Dates Times version 2.2.2

31 Aug 06:25
Compare
Choose a tag to compare

Changes & Deprecations

  • Deprecates the option :format on Cldr.DateTime.Relative.to_string/3 in favour of :style. :format will be removed with ex_cldr_dates_times version 3.0

Bug Fixes

  • Date, Time and DateTime to_string/3 returns an error tuple immediately when a format code is used but no data is available to fulfil it

Cldr Dates Times version 2.2.1

23 Aug 01:23
Compare
Choose a tag to compare

Bug Fixes

  • Fix @spec for Cldr.Date.to_string/3, Cldr.Time.to_string/3 and Cldr.DateTime.to_string/3 as well as the ! variants.

Cldr Dates Times version 2.2.0

22 Aug 22:13
Compare
Choose a tag to compare

Breaking change

  • Support Elixir 1.8 and later only since this package depends on ex_cldr_calendars which required Elixir 1.8.

Bug Fixes

  • Fix references to Cldr.get_current_locale/0 to the current Cldr/get_locale/0

  • Fix dialyzer warnings

Cldr Dates Times vision 2.1.0

16 Jun 09:39
Compare
Choose a tag to compare

Enhancements

  • All calling Date, Time and DateTime to_string/3 as to_string/1 omitting the backend and providing options. The backend will default to Cldr.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 the W format which is now implemented as well.

Cldr Dates Times version 2.0.2

12 Jun 14:55
Compare
Choose a tag to compare

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 version 2.0.1

09 Jun 09:59
Compare
Choose a tag to compare

Bug Fixes

  • Fixes a formatter code generation error when a format is a tuple form not a string form.

Cldr Dates Times version 2.0.0

09 Jun 01:39
Compare
Choose a tag to compare

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_times requires a minimum Elixir version of 1.8. It depends on Calendar 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 to MyApp.Cldr.DateTime.to_string/3 (assuming your configured backend module is called MyApp.Cldr).

Enhancements

  • Correctly calculates week_of_year

  • Supports Calendar.ISO and any calendar defined with Cldr.Calendar (see ex_cldr_calendars)

Known limitations

  • Does not calculate week_of_month. If called will return 1 for 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:

  1. Create a backend module:
defmodule MyApp.Cldr do
  use Cldr,
    locales: ["en", "fr", "ja"],
    providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime]

end
  1. Update config.exs configuration to specify this backend as the system default:
config :ex_cldr,
  default_locale: "en",
  default_backend: MyApp.Cldr
  1. Replace calls to Date. Time and DateTime functions to_string/2 with calls to to_string/3 where the second parameter is a backend module.