You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+8-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## Cldr_Dates_Times v2.19.0
6
6
7
-
This is the changelog for Cldr_Dates_Times v2.19.0 released on _____, 2024. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_cldr_dates_times/tags)
7
+
This is the changelog for Cldr_Dates_Times v2.19.0 released on Jult 8th, 2024. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_cldr_dates_times/tags)
8
8
9
9
### Bug Fixes
10
10
@@ -16,10 +16,16 @@ This is the changelog for Cldr_Dates_Times v2.19.0 released on _____, 2024. For
16
16
17
17
* 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`.
18
18
19
-
* Adds support for deriving the "best match" format for a date based upon the users requested format or deriving from the available date fields.
19
+
* 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`.
20
+
21
+
* 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`.
22
+
23
+
* 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.
20
24
21
25
* 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.
Copy file name to clipboardexpand all lines: README.md
+14-8
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ A `backend` module is required that is used to host the functions that manage CL
52
52
default_backend:MyApp.Cldr
53
53
```
54
54
55
-
##Usage Introduction
55
+
## Introduction
56
56
57
57
`ex_cldr_dates_times` is an addon library application for [ex_cldr](https://hex.pm/packages/ex_cldr) that provides localisation and formatting for dates, times and date_times.
58
58
@@ -83,11 +83,11 @@ iex> h MyApp.Cldr.DateTime.to_string
83
83
iex> h MyApp.Cldr.DateTime.Relative.to_string
84
84
```
85
85
86
-
## Date, Time and DateTime Localization Formatting
86
+
## Date, Time and DateTime Localization Formats
87
87
88
-
Dates, Times and DateTimes can be formatted using:
88
+
Dates, Times and DateTimes can be formatted using standard formats, format strings or format IDs.
89
89
90
-
*The format types defined for each locale. These format types provide cross-locale standardisation and therefore should be preferred where possible. The format types, implemented for `MyApp.Cldr.Date.to_string/2`, `MyApp.Cldr.Time.to_string/2`,`MyApp.Cldr.DateTime.to_string/2` are `:short`, `:medium`, `:long` and `:full`. The default is `:medium`. For example, assuming a configured backend called `MyApp.Cldr`:
90
+
*Standard formats provide cross-locale standardisation and therefore should be preferred where possible. The format types, implemented for `MyApp.Cldr.Date.to_string/2`, `MyApp.Cldr.Time.to_string/2`,`MyApp.Cldr.DateTime.to_string/2` are `:short`, `:medium`, `:long` and `:full`. The default is `:medium`. For example, assuming a configured backend called `MyApp.Cldr`:
@@ -103,17 +103,17 @@ Dates, Times and DateTimes can be formatted using:
103
103
{:ok, "30 mai 2020 à 03:52:56 UTC"}
104
104
```
105
105
106
-
*A user specified format string. A format string uses one or more formatting symbols to define what date and time elements should be places in the format. A simple example to format the time into hours andminutes:
106
+
*Format strings use one or more formatting symbols to define what date and time elements should be places in the format. A simple example to format the time into hours andminutes:
*For `DateTime`s there is also a set of predefined format name. These format names are returned by `MyApp.Cldr.DateTime.Format.date_time_available_formats/0` (assuming your backend is `MyApp.Cldr`). The set of common format names across all locales configured in `ex_cldr` can be returned by `Cldr.DateTime.Format.common_date_time_format_names`. These format names can be used with the `:format` parameter to `Cldr.DateTime.to_string/2` module only.
113
+
*FormatIDs are an atom that is a key into a map of formats defined by CLDR. These format IDs are returned by `MyApp.Cldr.DateTime.Format.date_time_available_formats/2` (assuming your backend is `MyApp.Cldr`). The set of common format names across all locales configured in `ex_cldr` can be returned by `MyApp.Cldr.DateTime.Format.common_date_time_format_names/0`.
0 commit comments