Skip to content

Conversation

@macchiati
Copy link
Member

@macchiati macchiati commented Apr 30, 2025

CLDR-18574

This narrows the coverage of iso8601 to only date patterns. For available and interval formats, that is tested by making sure that the id value matches a regular expression that contains 2 "date" pattern characters. That uses the line:

<coverageVariable key="%iso8601IDs" value='([^\\x{22}]*(Gy|y[MQw]|M[EdW]|Ed)[^\\x{22}]*)'/>
<!-- two different date characters. Because they are ordered we can test pairs -->

The regex has the optional non " characters before and after, and sees if there are certain pairs, like Gy or Md. That is, it excludes singleton date characters like value='d', because ordering does not matter for them.

Adds a test, and a couple of GP utility classes.

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

@macchiati
Copy link
Member Author

macchiati commented Apr 30, 2025

FYI, with the debug flag on, the unit test shows the levels that result. The comprehensive ones will not show up in the survey tool. They will be be the same as Gregorian. They are included here so that we can verify that we don't want any of them.

The ones we do want are date (or date interval) skeletons with more than one field. These are the ones that have ordering issues.

The ones we don't want are:

  • time field skeletons
  • singleton date field skeletons (ie, no ordering issues)
  • a couple of patterns (append/fallback)
Coverage Loc Page Header Code Value
moderate en ISO 8601 Formats - Standard - Date Formats full y MMMM d, EEEE
moderate en ISO 8601 Formats - Standard - Date Formats long y MMMM d
moderate en ISO 8601 Formats - Standard - Date Formats medium y MMM d
moderate en ISO 8601 Formats - Standard - Date Formats short y-MM-dd
moderate en ISO 8601 Formats - Flexible - Date Formats MMMMW-one MMMM 'week' W
moderate en ISO 8601 Formats - Flexible - Date Formats MMMMW-other MMMM 'week' W
moderate en ISO 8601 Formats - Flexible - Date Formats yw-one Y 'week' w
moderate en ISO 8601 Formats - Flexible - Date Formats yw-other Y 'week' w
moderate en ISO 8601 Formats - Flexible - Date Formats Ed d, E
moderate en ISO 8601 Formats - Flexible - Date Formats Gy G y
moderate en ISO 8601 Formats - Flexible - Date Formats GyMd G y-MM-dd
moderate en ISO 8601 Formats - Flexible - Date Formats GyMMM G y MMM
moderate en ISO 8601 Formats - Flexible - Date Formats GyMMMd G y MMM d
moderate en ISO 8601 Formats - Flexible - Date Formats GyMMMEd G y MMM d, E
moderate en ISO 8601 Formats - Flexible - Date Formats Md MM-dd
moderate en ISO 8601 Formats - Flexible - Date Formats MEd MM-dd, E
moderate en ISO 8601 Formats - Flexible - Date Formats MMMd MMM d
moderate en ISO 8601 Formats - Flexible - Date Formats MMMEd MMM d, E
moderate en ISO 8601 Formats - Flexible - Date Formats MMMMd MMMM d
moderate en ISO 8601 Formats - Flexible - Date Formats yM y-MM
moderate en ISO 8601 Formats - Flexible - Date Formats yMd y-MM-dd
moderate en ISO 8601 Formats - Flexible - Date Formats yMEd y-MM-dd, E
moderate en ISO 8601 Formats - Flexible - Date Formats yMMM y MMM
moderate en ISO 8601 Formats - Flexible - Date Formats yMMMd y MMM d
moderate en ISO 8601 Formats - Flexible - Date Formats yMMMEd y MMM d, E
moderate en ISO 8601 Formats - Flexible - Date Formats yMMMM y MMMM
moderate en ISO 8601 Formats - Flexible - Date Formats yQQQ y QQQ
moderate en ISO 8601 Formats - Flexible - Date Formats yQQQQ y QQQQ
moderate en ISO 8601 Formats - Intervals - Date Formats Gy/G G y – G y
moderate en ISO 8601 Formats - Intervals - Date Formats Gy/y y–y
moderate en ISO 8601 Formats - Intervals - Date Formats GyM/G G y-MM – G y-MM
moderate en ISO 8601 Formats - Intervals - Date Formats GyM/M G y-MM – y-MM
moderate en ISO 8601 Formats - Intervals - Date Formats GyM/y G y-MM – y-MM
moderate en ISO 8601 Formats - Intervals - Date Formats GyMd/d G y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats GyMd/G G y-MM-dd – G y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats GyMd/M G y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats GyMd/y G y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats GyMEd/d G y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMEd/G G y-MM-dd, E – G y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMEd/M G y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMEd/y G y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMM/G G y MMM – G y MMM
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMM/M G y MMM–MMM
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMM/y G y MMM – y MMM
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMd/d G y MMM d–d
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMd/G G y MMM d – G y MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMd/M G y MMM d – MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMd/y G y MMM d – y MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMEd/d G y MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMEd/G G y MMM d, E – G y MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMEd/M G y MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats GyMMMEd/y G y MMM d, E – y MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats Md/d MM-dd – MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats Md/M MM-dd – MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats MEd/d MM-dd, E – MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats MEd/M MM-dd, E – MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats MMMd/d MMM d–d
moderate en ISO 8601 Formats - Intervals - Date Formats MMMd/M MMM d – MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats MMMEd/d MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats MMMEd/M MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats yM/M y-MM – y-MM
moderate en ISO 8601 Formats - Intervals - Date Formats yM/y y-MM – y-MM
moderate en ISO 8601 Formats - Intervals - Date Formats yMd/d y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats yMd/M y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats yMd/y y-MM-dd – y-MM-dd
moderate en ISO 8601 Formats - Intervals - Date Formats yMEd/d y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMEd/M y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMEd/y y-MM-dd, E – y-MM-dd, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMMM/M y MMM–MMM
moderate en ISO 8601 Formats - Intervals - Date Formats yMMM/y y MMM – y MMM
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMd/d y MMM d–d
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMd/M y MMM d – MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMd/y y MMM d – y MMM d
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMEd/d y MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMEd/M y MMM d, E – MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMEd/y y MMM d, E – y MMM d, E
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMM/M y MMMM–MMMM
moderate en ISO 8601 Formats - Intervals - Date Formats yMMMM/y y MMMM – y MMMM
comprehensive en ISO 8601 Formats - Standard - Time Formats full HH:mm:ss zzzz
comprehensive en ISO 8601 Formats - Standard - Time Formats long HH:mm:ss z
comprehensive en ISO 8601 Formats - Standard - Time Formats medium HH:mm:ss
comprehensive en ISO 8601 Formats - Standard - Time Formats short HH:mm
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats full {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats long {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats medium {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats short {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats full-atTime {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats full-relative {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats long-atTime {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats long-relative {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats medium-atTime {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats medium-relative {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats short-atTime {1} {0}
comprehensive en ISO 8601 Formats - Standard - Date & Time Combination Formats short-relative {1} {0}
comprehensive en ISO 8601 Formats - Flexible - Date Formats d d
comprehensive en ISO 8601 Formats - Flexible - Date Formats E ccc
comprehensive en ISO 8601 Formats - Flexible - Date Formats M L
comprehensive en ISO 8601 Formats - Flexible - Date Formats MMM LLL
comprehensive en ISO 8601 Formats - Flexible - Date Formats y y
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats Bh h B
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats Bhm h:mm B
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats Bhms h:mm:ss B
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats EBhm E h:mm B
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats EBhms E h:mm:ss B
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats Ehm E h:mm a
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats Ehms E h:mm:ss a
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats h h a
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats hm h:mm a
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats hms h:mm:ss a
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats hmsv h:mm:ss a v
comprehensive en ISO 8601 Formats - Flexible - 12 Hour Time Formats hmv h:mm a v
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats EHm E HH:mm
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats EHms E HH:mm:ss
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats H HH
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats Hm HH:mm
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats Hms HH:mm:ss
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats Hmsv HH:mm:ss v
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats Hmv HH:mm v
comprehensive en ISO 8601 Formats - Flexible - 24 Hour Time Formats ms mm:ss
comprehensive en ISO 8601 Formats - Flexible - Append Timezone {0} {1}
comprehensive en ISO 8601 Formats - Intervals - Date Formats Bh/B h B – h B
comprehensive en ISO 8601 Formats - Intervals - Date Formats Bh/h h–h B
comprehensive en ISO 8601 Formats - Intervals - Date Formats Bhm/B h:mm B – h:mm B
comprehensive en ISO 8601 Formats - Intervals - Date Formats Bhm/h h:mm–h:mm B
comprehensive en ISO 8601 Formats - Intervals - Date Formats Bhm/m h:mm–h:mm B
comprehensive en ISO 8601 Formats - Intervals - Date Formats d/d d–d
comprehensive en ISO 8601 Formats - Intervals - Date Formats M/M MM–MM
comprehensive en ISO 8601 Formats - Intervals - Date Formats MMM/M LLL–LLL
comprehensive en ISO 8601 Formats - Intervals - Date Formats y/y y–y
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats h/a h a – h a
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats h/h h–h a
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hm/a h:mm a – h:mm a
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hm/h h:mm–h:mm a
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hm/m h:mm–h:mm a
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hmv/a h:mm a – h:mm a v
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hmv/h h:mm–h:mm a v
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hmv/m h:mm–h:mm a v
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hv/a h a – h a v
comprehensive en ISO 8601 Formats - Intervals - 12 Hour Time Formats hv/h h–h a v
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats H/H HH–HH
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats Hm/H HH:mm–HH:mm
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats Hm/m HH:mm–HH:mm
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats Hmv/H HH:mm–HH:mm v
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats Hmv/m HH:mm–HH:mm v
comprehensive en ISO 8601 Formats - Intervals - 24 Hour Time Formats Hv/H HH–HH v
comprehensive en ISO 8601 Formats - Intervals - Fallback Fallback {0} – {1}

@macchiati
Copy link
Member Author

I changed the printout so that reviewers could see more clearly which of the items are being excluded.

macchiati added 2 commits May 1, 2025 21:15
So that reviewers could see which items are excluded (comprehensive) or not (moderate/modern).
To show what happens with more values.
Copy link
Member

@srl295 srl295 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

// drop IDs unless they have y+M or M+d
List<String> raw =
Splitters.VBAR.splitToList(
"MMMMd|MMMMW|MMMMW|yw|yw|yQQQ|yQQQQ|Gy|Gy|GyM|GyM|GyM|GyMd|GyMd|GyMd|GyMd|GyMEd|GyMEd|GyMEd|GyMEd|GyMMM|GyMMM|GyMMM|GyMMMd|GyMMMd|GyMMMd|GyMMMd|GyMMMEd|GyMMMEd|GyMMMEd|GyMMMEd|Md|Md|MEd|MEd|MMMd|MMMd|MMMEd|MMMEd|Ed|yM|yM|yMd|yMd|yMd|yMEd|yMEd|yMEd|yMMM|yMMM|yMMMd|yMMMd|yMMMd|yMMMEd|yMMMEd|yMMMEd|yMMMM|yMMMM");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be generated from 'those without y+M or M+d'? seems fragile to have yet another static list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for testing.

}
}
}
if (Level.CORE_TO_MODERN.contains(level) == expectedComprehensive) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (Level.CORE_TO_MODERN.contains(level) == expectedComprehensive) {
if (!level.isAbove(MODERN) == expectedComprehensive) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion but I didn't want to wait on getting PR in.

@macchiati macchiati merged commit 98d788e into main May 2, 2025
16 checks passed
@macchiati macchiati deleted the CLDR-18574-Fix-coverage-for-iso8601 branch May 2, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants