This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Section "9.8.4.1 The picture string" of the format date/time functions includes the [w] specifier that means "week in month." Additionally, the test format-dateTime-011 uses [w] in conjunction with the ISO calendar. However, the ISO 8601 specification has no notion of "week in month" (it only has the notion of "week in year"). Somewhat related, the C function strftime(3) also has no conversion specification for "week in month." Hence, [w] has no precise meaning for ISO 8601 or in general.
Yes, I agree it's problematic. In my XSLT 2.0 book I say "ISO 8601 does not define a numbering for weeks within a month. You will have to see what your implementation returns". The difficulty is that [w] is available in XSLT 2.0, even though underspecified, so removing it has its own problems. We could (a) attempt a specification of what it means (b) say that the result is implementation-defined (c) say that it's implementation-defined whether [w] is supported (d) withdraw or deprecate it I'm going to specifically ask for XSL WG discussion of this.
On (a), the only specification I can think of, is to follow the same rules for the first week of the year in ISO 8601. However, definitions on "week of the month" varies even greater than the first week of the year definitions. Here's an interesting thread on the subject that I came across: http://linguistlist.org/issues/12/12-1858.html On (b): I think this is fair On (c) that would mean a backward compatibility issue. Don't think we should want to do that. On (d) personally, I prefer that option, but as with (c), it is a backward compatibility issue if we do so. I don't see any harm in keeping it around, though a note on its underspecification in ISO 8601 might be a good idea.
The XSLT WG discussed this at the 2013-03-28 telcon. A "w" specifier is found in many programming language function libraries and environments [notably it is included in Java]. The consensus was to keep the "w" specifier and specify the semantics. Proposed changes to F&O: - In the last item in the list: "The language is used to select the appropriate language-dependent forms of: names (for example, of months) numbers expressed as words or as ordinals (twenty, 20th, twentieth) hour convention (0-23 vs 1-24, 0-11 vs 1-12) first day of week, first week of year" add "first week of the month". - After the paragraph following the list (starting "Where appropriate...") add a paragraph: "ISO 8601 includes a definition of the first day of the week and first week of the year, but does not define the first week of the month. For this recommendation the ISO 8601 definitions are augmented by a specification that each week begins on a Monday and is associated with the month that contains that week's Thursday." - In addition it seems to make sense to move the reference to ISO 8601 from non-normative to normative.
And what does [w] mean for non-ISO calendars? For example, the "AD" calendar? You ought to define what [w] means at least for the "AD" calendar since that's the most common other calendar.
The definition of the week varies and such local variations are handled based on language and place. For example the first day of week (using the "AD" calendar) is commonly either Sunday or Monday and we cannot mandate either to be used. Only the ISO "calendar" is precicesly defined and includes a definitionb of "W" - week in year. Thus it is appropriate for F&O to include a definition of "w" for use with the ISO calendar specification. For other calendars - including the AD one - the result is implementation defined and should be based on the conventions based on language and place.
I was asked to draft text to implement the suggstion by Anders in comment 5. The following text is proposed: ISO 8601 does not define a numbering for weeks within a month. When the <code>w</code> component is used, the convention to be adopted is that each Monday-to-Sunday week is considered to fall within a particular month if its Thursday occurs in that month; the weeks that fall in a particular month under this definition are numbered starting from 1. Thus, for example, 29 January 2013 falls in week 5 because the Thursday of the relevant week (31 January 2013) is the fifth Thursday in January, and 1 February 2013 is also in week 5 for the same reason.
The text has been agreed (and is present in the new CR published today).