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

CLDR Ticket #8260(accepted tools)

Opened 2 years ago

Last modified 6 months ago

Problems with interval formats

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

Description (last modified by mark) (diff)

While working on http://bugs.icu-project.org/trac/ticket/11583, I noticed the following problems with our data. After looking this over we might want to break the following problems into 2 or more bugs.

  1. We probably should have either an error or warning when an intervalFormatItem doesn't have all the greatest differences.

es.xml

<intervalFormatItem id="yMMM">
	<greatestDifference id="M">MMM–MMM y</greatestDifference>
	<greatestDifference id="y">MMM y–MMM y</greatestDifference>
</intervalFormatItem>

es_419.xml

<intervalFormatItem id="yMMM">
	<greatestDifference id="y" draft="contributed">MMM 'de' y – MMM 'de' y</greatestDifference>
</intervalFormatItem>

This will result in the 'de' only showing up when the year is the greatest difference, not with the month. Looks very inconsistent.

  1. I found that the intervals are often inconsistent with the date formats. I'd recommend a test on the CLDR side to find the problems early, and either show error or warning to user. The following just checks (logically) that you can remove a string from the interval format and the result is the date format.
  • For skeleton MMMM: mismatch between date format «LLLL» and date interval format «MMMM – MMMM».
  • For skeleton MMM: mismatch between date format «LLL» and date interval format «MMM – MMM».
  • For skeleton yMMdd: mismatch between date format «MM/dd/y» and date interval format «M/d/y – M/d/y».
  • For skeleton MM: mismatch between date format «LL» and date interval format «M – M».
  • For skeleton M: mismatch between date format «L» and date interval format «M – M».
  1. We are inconsistent in use of LL. I think that in all the languages that care about the difference between M and L, the only time it matters is when there is a 'd'. We could run this by our vetters, and if it is acceptable (doesn't have to be optimal) for our languages, we could automatically make the changes on input, which is much easer than errors, warnings, or post-processing.
  1. We are inconsistent about spacing around separators. But where we are consistent, I think we are overly consistent. What I would suggest is the following. We could run this by our vetters, and if it is acceptable (doesn't have to be optimal) for our languages, we could automatically make the changes on input, which is much easer than errors, warnings, or post-processing.
  1. Where the items on both side of the separator are the same field and are numeric, don't use spaces.

MMMM d – d => MMMM d–d

  1. Otherwise, use spaces.

d MMM–d MMM y => d MMM – d MMM y

  1. I think another problem with ICU's implementation is that the interval formats are not adjusted in the same way as the availableFormats are. We should make sure that is clear in the spec (and file a bug to fix in ICU).

Example listing:

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMMMd» pattern: «d 'de' MMMM 'de' y» intervalPattern1: «d 'de' MMMM–» intervalPattern2: «d 'de' MMMM 'de' y» startDate: «19 de enero de 2009» endDate: «22 de abril de 2009» interval: «19 de enero–22 de abril de 2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMMM» pattern: «MMMM 'de' y» intervalPattern1: «MMMM–» intervalPattern2: «MMMM 'de' y» startDate: «enero de 2009» endDate: «abril de 2009» interval: «enero–abril de 2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «MMMM» pattern: «LLLL» intervalPattern1: «MMMM–» intervalPattern2: «MMMM» startDate: «Enero» endDate: «Abril» interval: «enero–abril»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMMd» pattern: «d MMM y» intervalPattern1: «d MMM–» intervalPattern2: «d MMM y» startDate: «19 ene. 2009» endDate: «22 abr. 2009» interval: «19 ene.–22 abr. 2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMM» pattern: «MMM y» intervalPattern1: «MMM–» intervalPattern2: «MMM y» startDate: «ene. 2009» endDate: «abr. 2009» interval: «ene.–abr. 2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «MMM» pattern: «LLL» intervalPattern1: «MMM–» intervalPattern2: «MMM» startDate: «Ene.» endDate: «Abr.» interval: «ene.–abr.»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMd» pattern: «d/MM/y» intervalPattern1: «d/M/y–» intervalPattern2: «d/M/y» startDate: «19/01/2009» endDate: «22/04/2009» interval: «19/1/2009–22/4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMMdd» pattern: «dd/MM/y» intervalPattern1: «d/M/y–» intervalPattern2: «d/M/y» startDate: «19/01/2009» endDate: «22/04/2009» interval: «19/1/2009–22/4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMM» pattern: «M/y» intervalPattern1: «M/y–» intervalPattern2: «M/y» startDate: «1/2009» endDate: «4/2009» interval: «1/2009–4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «MM» pattern: «LL» intervalPattern1: «M–» intervalPattern2: «M» startDate: «01» endDate: «04» interval: «1–4»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMdd» pattern: «dd/M/y» intervalPattern1: «d/M/y–» intervalPattern2: «d/M/y» startDate: «19/1/2009» endDate: «22/4/2009» interval: «19/1/2009–22/4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yMd» pattern: «d/M/y» intervalPattern1: «d/M/y–» intervalPattern2: «d/M/y» startDate: «19/1/2009» endDate: «22/4/2009» interval: «19/1/2009–22/4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «yM» pattern: «M/y» intervalPattern1: «M/y–» intervalPattern2: «M/y» startDate: «1/2009» endDate: «4/2009» interval: «1/2009–4/2009»

(DateIntervalFormatTest.java:1495) es_419 skeleton: «M» pattern: «L» intervalPattern1: «M–» intervalPattern2: «M» startDate: «1» endDate: «4» interval: «1–4»

Attachments

Change History

comment:1 Changed 2 years ago by mark

  • Description modified (diff)

comment:2 Changed 2 years ago by mark

  • Description modified (diff)

comment:3 Changed 2 years ago by mark

  • Description modified (diff)

comment:4 Changed 2 years ago by emmons

  • Owner changed from anybody to pedberg
  • Priority changed from assess to medium
  • Status changed from new to assigned
  • Component changed from unknown to data-main
  • Milestone changed from UNSCH to 28

Assigning to Peter to handle #2-4. #1 is already in a separate ticket (John).

comment:5 Changed 2 years ago by pedberg

The part of #1 about CLDRModify not minimizing in logical groups is in a separate ticket. We may still want a warning in ST when the full data is not entered for a logical group.

For #4b, may only apply if separator is en-dash or hyphen-minus, not em-dash.

For #5, part of the problem is that ICU does not fallback to root for intervalFormats. Problem?

comment:6 Changed 2 years ago by markus

  • Type set to data

comment:7 Changed 2 years ago by pedberg

  • Phase changed from dsub to dvet

comment:8 Changed 2 years ago by srl

  • Status changed from assigned to accepted

comment:9 Changed 2 years ago by pedberg

  • Milestone changed from 28 to 29

comment:10 Changed 2 years ago by mark

  • Priority changed from medium to major

This is really a major bug, not medium. Bumping it up to get more attention next time.

comment:11 Changed 23 months ago by emmons

  • Milestone changed from 29 to upcoming

Auto move of all 29 -> upcoming

comment:12 Changed 19 months ago by mark

  • Milestone changed from upcoming to 30

comment:13 Changed 12 months ago by pedberg

  • Phase changed from dvet to dsub
  • Type changed from data to tools
  • Component changed from main to datetime
  • Milestone changed from 30 to 31

Will need to move this to 31

comment:14 Changed 7 months ago by pedberg

  • Phase changed from dsub to dvet

comment:15 Changed 6 months ago by pedberg

  • Phase changed from dvet to dsub
  • Milestone changed from 31 to 32
View

Add a comment

Modify Ticket

Action
as accepted
Author


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

 
Note: See TracTickets for help on using tickets.