Skip to content

Commit 516a506

Browse files
authored
CLDR-18350 Add InfoHub instructions for new "relative" variant of the date-time combining pattern (#4564)
1 parent d003f0e commit 516a506

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

docs/site/translation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,22 @@ Seven new emoji have been added (images above). These were released in Unicode 1
102102

103103
As new locales reach Basic Coverage, their language names have been added for locales targeting modern coverage: Anii, Kuvi, …, Zhuang
104104

105+
### DateTime formats
106+
107+
There is a new “-relative” variant for [Date-Time Combined Formats](/translation/date-time/date-time-patterns#date-time-combined-formats).
108+
109+
Before CLDR 48, there were two variants:
110+
- A “standard” variant for combining date with time, typically without literal text. In English this was “{1}, {0}”
111+
and resulted in combined date patterns like “March 20, 3:00 PM“, “March 20, 3:00-5:00 PM”, “tomorrow, 3:00 PM”, “tomorrow, 3:00-5:00 PM”, “in 2 days, 3:00 PM”
112+
- An “atTime” variant for combining date with a single time (not a range). For longer styles in English this was “{1} 'at' {0}”
113+
and resulted in combined date patterns like “March 20 at 3:00 PM“, “tomorrow at 3:00 PM”, “2 days ago at 3:00 PM”.
114+
115+
However, in some languages the use of a relative date such as “tomorrow” or “2 days ago” required a different combining pattern than for a fixed date like “March 20”.
116+
So in CLDR 48 a new “relative” variant is introduced. This will be used (instead of the “atTime” variant) for the combination
117+
of a relative date and a single time. If you do not supply this, that combination will fall back to using the “standard” variant;
118+
in English that would produce “tomorrow, 3:00 PM”. If instead you want the same combining behavior for a relative date with a single time as for a
119+
fvfixed date with single time (as was the case in CLDR 47 and earlier), then for each length style copy the existing “atTime” form to the new “relative” form.
120+
105121
### Metazones
106122

107123
There is a new metazone for Kazakhstan (which merged its two time zones).

docs/site/translation/date-time/date-time-patterns.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Date/Time Patterns
44

55
# Date/Time Patterns
66

7-
_Last updated: 2018-May-14_
7+
_Last updated: 2025-Apr-01_
88

99
## Patterns Introduction
1010

@@ -286,47 +286,54 @@ What you want to pay attention to are:
286286
- Remove a space if your language does not use spaces, which is common for many East Asian languages
287287
- Add a comma, or other punctuation that your language requires between the patterns
288288

289-
There are four formats: full, long, medium, and short. _Each of these may come in two variants_:
289+
There are four format length styles: full, long, medium, and short. Each of these may come in up to three variants:
290290

291-
- _The “-atTime” variant, which specifies a date at a particular time, typically for an event. In the longer formats (such as full and long), this “-atTime” form may have a combining word betwen the date and the time, for example “{1} 'at' {0}” to produce an English example like “Sunday, September 25 at 1:30 PM”)._
292-
- _The standard variant, which is used for multuple purposes and typically does not include any literal text, for example “{1}, {0}”. Usage examples include:_
293-
- _Wall clock time: “Sunday, September 25, 1:30 PM”_
294-
- _Combining a date with a time range: “Sunday, September 25, 1:30 – 3:00 PM”_
291+
- The standard variant (required), which is used for multiple purposes and typically does not include any literal text, for example “{1}, {0}”. Usage examples include:
292+
- Wall clock time: “Sunday, September 25, 1:30 PM”
293+
- Combining a date with a time range: “Sunday, September 25, 1:30 – 3:00 PM”
294+
- The “-atTime” variant, which specifies a **fixed** date at a particular time, typically for an event. In the longer formats (such as full and long),
295+
this “-atTime” form may have a combining word linking the date and the time, for example “{1} 'at' {0}” to produce an English example like “Sunday, September 25 at 1:30 PM”).
296+
If there is no “-atTime” variant, the standard variant will be used for this combination.
297+
- The “-relative” variant _(new in CLDR 48)_, which specifies a **relative** date at a particular time, typically for an event. In the longer formats (such as full and long),
298+
this “-relative” form may have a combining word linking the date and the time, for example “{1} 'at' {0}” to produce an English example like “tomorrow at 1:30 PM”.
299+
If there is no “-relative” variant, the standard variant will be used for this combination.
295300

296-
_Before CLDR 42, there was only one variant for these. In English that variant used the “-atTime” style, as did many other locales. For CLDR 42, that  “-⁠atTime” data has been moved to the “-⁠atTime” variants, and the standard data has initially been extrapolated from the mediu or short formats without literal text. However, it needs to be checked._
301+
_Before CLDR 42, there was only one variant for these. In English that variant used the “-atTime” style, as did many other locales. For CLDR 42, that  “-⁠atTime” data was moved to the “-⁠atTime” variants, and the standard data was initially extrapolated from the medium or short formats without literal text._
297302

298-
The determination of which to use by developers using CLDR data is normally based on the date style, for example:
303+
_In CLDR 48, the “-relative” variant is split out of the “-atTime” variant to allow a different combining form to be used when the date part is relative (“tomorrow”) instead of a fixed date (“March 20”).
304+
If you want the combination of a relative date and single time to be formatted as it was in CLDR 47, then you will need to copy the “-atTime” variant data to the new “-relative” variant._
305+
306+
The determination of which length style to use by developers using CLDR data is normally based on the date style, for example:
299307

300308
- If the date has a full month and weekday name, use the **full** combining pattern.
301309
- If the date has numeric month, use the **short** version of the combining pattern.
302310

303311
Following are examples on how the data can be different by locale with different combinations of format length. (note: {1}=date format with {0}= time format)
304312

305-
 
306313

307314
Another way to look at the example with original patterns and combined result:
308315

309316
| Pattern | English | German | Japanese |
310317
|---|---|---|---|
311318
| [Full](https://st.unicode.org/cldr-apps/v#/fr/Gregorian/4caf0def588f4e8) {1} 'at' {0}<br /><br /> {Full form of the date format} at {full form of the time format} | {1} 'at' {0}<br /><br /> Sunday, September 5, 1999 at 1:25:59 PM Eastern Standard Time | {1} 'um' {0}<br /><br /> Sonntag, 5. September 1999 um 13:25:59 Nordamerikanische Ostküsten-Normalzeit | {1} {0}<br /><br /> 1999年9月5日日曜日 13時25分59秒 アメリカ東部標準時 |
312-
| [Medium](https://st.unicode.org/cldr-apps/v#/fr/Gregorian/7a365a21694f0127) {1}, {0}<br /><br /> {medium form of the date format}, {medium form of the time format}<br /><br /> Notice the comma and space between the date portion and the time portion. | {1}, {0}<br /><br /> Sep 5, 1999, 1:25:59 PM | {1}, {0} Result: 05.09.1999, 13:25:59 | {1} {0}<br /><br /> 1999/09/05 13:25:59 |
319+
| [Medium](https://st.unicode.org/cldr-apps/v#/fr/Gregorian/7a365a21694f0127) {1}, {0}<br /><br /> {medium form of the date format}, {medium form of the time format}<br /><br /> Notice the comma and space between the date portion and the time portion. | {1}, {0}<br /><br /> Sep 5, 1999, 1:25:59 PM | {1}, {0}<br /><br /> 05.09.1999, 13:25:59 | {1} {0}<br /><br /> 1999/09/05 13:25:59 |
320+
313321

314-
| | | | |
315-
|---|---|---|---|
316322
| date pattern | time pattern | date-time combining pattern used | formatted example |
323+
|---|---|---|---|
317324
| MMMM d, y | h:mm a | [long] {1} 'at' {0} | September 14, 1999 at 1:25 PM |
318325
| M/d/yy | h:mm a | [short] {1}, {0} | 9/14/99, 1:25 PM |
319326

320-
| | | |
321-
|---|---|---|
327+
328+
## Week-Of Patterns
329+
322330
| Survey Tool field | English pattern | Pattern characters |
331+
|---|---|---|
323332
| yw-one | 'week' w 'of' Y (example: Week 37 of 2009) | w designates the number of the week within a year calculated for week-of year purposes and indicated using the pattern character Y (instead of the normal year designator y). The year indicated by Y typically begins on the locale’s first day of the week and ends on the last day of the week, so its transitions may differ by a few days from the standard year indicated by y. |
324333
| yw-other | 'week' w 'of' Y | |
325334
| MMMMW-one | 'week' W 'of' MMMM (example: Week 3 of April) | W designates the number of the week within the month |
326335
| MMMMW-other | 'week' W 'of' MMMM | |
327336

328-
## Week-Of Patterns
329-
330337
The week-of date patterns were introduced in CLDR 30 for enumerating week count in larger periods, e.g. “week 15 of 2016” or “week 4 of April”. The Survey Tool fields and corresponding English entries are shown below:
331338

332339
For developers who use CLDR data, 

0 commit comments

Comments
 (0)