This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Under "9.8.4.4 Formatting the Year Component" the text says "The rules for the Year component (Y) are the same as those in 9.8.4.3 Formatting Integer-Valued Date/Time Components, except that the value of the year as output is the value of the year component of the supplied value modulo ten to the power N where N is determined as follows: 1. If the width modifier is present and includes a maximum width, then that maximum width, or 2, whichever is greater. 2. Otherwise, if the first presentation modifier takes the form of a decimal-digit-pattern, then the number of optional-digit-signs and mandatory-digit-signs in that decimal-digit-pattern, or 2, whichever is greater." It's not clear whether a width modifier of the form: 2-* is considered to include a maximum width. Consider the formats (A) [Y0,3] (B) [Y0,3-6] (C) [Y0,3-*] In (A), a width modifier is present, but does not include a maximum width. Therefore N = 2 (rule 2 applies). This seems odd. Surely the maximum width is unbounded? In (B), a width modifier is present, width a maximum width. Therefore N = max(6, 2), i.e. N = 6 (rule 1 applies). In (C), a width modifier is present, includes a maximum width, but the maximum width does not have an integer value. This relates to test case format-date-043.
Related, [Y0] has no width modifier. Does [Y0,*-*]?
Related, With formats [f111,2] or [f111,2-*] Given the text "A format token containing more than one digit, such as 001 or 9999, sets the minimum and maximum width to the number of digits appearing in the format token; if a width modifier is also present, then the width modifier takes precedence." is the maximum width here unbounded or 3?
It's also unclear when formatting "[Y]" whether, when applying the rules of 9.8.4.4 the default presentation modifier of "1" applies before considering rule (2). Should the default presentation modifier for Y not be 0001?
I think "includes a maximum width" should be read as "defines a finite maximum width". So case (C) does not define a finite maximum width. I'm open to suggestions on [Y0]. For fractional seconds we treat a picture with a single digit specially and we should probably do so here.
I propose the following rewrite: The rules for the Year component (Y) are the same as those in <specref ref="formatting-integer-valued-components"/>, except that the value of the year as output is the value of the year component of the supplied value modulo ten to the power <var>N</var> where <var>N</var> is determined as follows: * If the width modifier is present and defines a finite maximum width, then that maximum width. * Otherwise, if the first presentation modifier takes the form of a decimal-digit-pattern, then: ** let W be the number of optional-digit-signs and mandatory-digit-signs in that decimal-digit-pattern. ** if W is 2 or more, then W. * Otherwise, <var>N</var> is infinity (that is the year is output in full).
At the meeting on 2016-09-13, the WG agreed to adopt the change proposed in comment #5. Action A-653-01 was raised to track this.
The changes have been applied.