[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search
 
Modify

CLDR Ticket #5488(closed enhancement: fixed)

Opened 3 years ago

Last modified 16 months ago

Support global switch for 12 vs 24 hour

Reported by: mark Owned by: mark
Component: main Data Locale:
Phase: Review: pedberg
Weeks: Data Xpath:
Xref:

ticket:5755

Description (last modified by mark) (diff)

On Android, we'd like to support a customization that causes all time formats to be 12 hour vs 24 hour. When I was looking into supporting this, it appears that it can mostly be supported by the existing structure, but not quite. In addition, there appear to be bugs in some locales, exposed by this examination. Those will be filed separately.

(this description was modified after some substantial revisions)


The goal is to be able to find, for each country, the preferred hour format (h, H, k, K) and the allowed formats, so that if h is not used in the country, it isn't switched to. For example, someone could use a variant of DateTimePatternGenerator that changed the hour format, but would not change to 'h' if not permitted.

To do this, add data in the following form. As per committee decision this is keyed by region, and is kept in supplemental.

<timeData>

<hours preferred="H" allowed="H K h" regions="JP"/>
<hours preferred="H" allowed="H h" regions="001 AD AF AM AO AR AT AW AX AZ BA BE BF BG BI BJ BL BO BR BY BZ CD CF CG CH CI CL CM CO CR CU CV CW CZ DE DK DO EA EC EE ES FI FO FR GA GB GE GF GG GI GN GP GQ GT GW HN HR HT HU IC ID IE IM IR IS IT JE KG KM KZ LA LI LK LT LU LV MC MD ME MF MG MK ML MM MN MQ MT MU MX MZ NC NE NI NL NO NP PA PE PF PH PL PT PY RE RO RS RW SC SE SI SK SM SN SR ST SV SX TG TH TJ TL TO TR UA UY UZ VE VN YT"/>
<hours preferred="H" allowed="H" regions="IL RU"/>
<hours preferred="h" allowed="H h" regions="AE AG AL AS AU BB BD BH BM BN BS BT BW CA CN CY DJ DM DZ EG EH ER ET FJ FM GD GH GL GM GR GU GY HK IN IQ JM JO KE KH KI KN KP KR KW KY LB LC LR LS LY MA MH MO MP MR MW MY NA NG NZ OM PG PK PR PS PW QA SA SB SD SG SL SO SS SY SZ TC TD TN TT TW TZ UG UM US VC VG VI VU WS YE ZA ZM ZW"/>

</timeData>

The changes include a program to generate the data (with some overrides) and a test.

Attachments

Change History

comment:1 Changed 3 years ago by mark

  • Owner changed from anybody to mark
  • Priority changed from assess to major
  • Type changed from unknown to enhancement
  • Status changed from new to assigned
  • Milestone changed from UNSCH to 23

Supplemental data looks like a better location. Needs revised design.

comment:2 Changed 3 years ago by mark

  • Component changed from unknown to data

comment:3 Changed 3 years ago by mark

  • Milestone changed from 23 to 23dres

comment:4 Changed 3 years ago by pedberg

Regarding this:

I was expecting to find that the available formats for "h" items would map to "H". However, that is not true.
<dateFormatItem id="hms" draft="contributed">h:mm:ss a</dateFormatItem>
This is probably wrong.

It is *not* wrong, it is absolutely the intended behavior. This is precisely to support user-selected 12-hour time in locales for which it is not the default. It is an *error* if h in the skeleton does not map to h or K in the pattern. Please see the documentation for hour in http://www.unicode.org/reports/tr35/#Date_Field_Symbol_Table.

comment:5 Changed 3 years ago by mark

  • Description modified (diff)
  • Review set to travis

The comment from Peter is correct. Amended the bug statement.

comment:6 Changed 3 years ago by travis

I am not familiar enough with this code to do a good review.

My question is how will this data that you added get into ICU resource bundles? Don't you have to modify jennifer's tool?

comment:7 Changed 3 years ago by mark

Final should look like the following:

<timeData>

<hours preferred="H" allowed="H K h" regions="JP"/>
<hours preferred="H" allowed="H h" regions="001 AD AF AM AO AR AT AW AX AZ BA BE BF BG BI BJ BL BO BR BY BZ CD CF CG CH CI CL CM CO CR CU CV CW CZ DE DK DO EA EC EE ES FI FO FR GA GB GE GF GG GI GN GP GQ GT GW HN HR HT HU IC ID IE IM IR IS IT JE KG KM KZ LA LI LK LT LU LV MC MD ME MF MG MK ML MM MN MQ MT MU MX MZ NC NE NI NL NO NP PA PE PF PH PL PT PY RE RO RS RW SC SE SI SK SM SN SR ST SV SX TG TH TJ TL TO TR UA UY UZ VE VN YT"/>
<hours preferred="H" allowed="H" regions="IL RU"/>
<hours preferred="h" allowed="H h" regions="AE AG AL AS AU BB BD BH BM BN BS BT BW CA CN CY DJ DM DZ EG EH ER ET FJ FM GD GH GL GM GR GU GY HK IN IQ JM JO KE KH KI KN KP KR KW KY LB LC LR LS LY MA MH MO MP MR MW MY NA NG NZ OM PG PK PR PS PW QA SA SB SD SG SL SO SS SY SZ TC TD TN TT TW TZ UG UM US VC VG VI VU WS YE ZA ZM ZW"/>

</timeData>

comment:8 Changed 3 years ago by mark

  • Review changed from travis to pedberg

comment:9 Changed 2 years ago by pedberg

  • Status changed from assigned to closed
  • Xref set to 5755
  • Resolution set to fixed

Follow-on cldrbug 5755:

comment:10 Changed 16 months ago by emmons

  • Milestone 23dres deleted

Milestone 23dres deleted

View

Add a comment

Modify Ticket

Action
as closed
The ticket will be disowned. The resolution will be deleted. Next status will be 'new'
Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.