<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21370</bug_id>
          
          <creation_ts>2013-03-22 02:20:33 +0000</creation_ts>
          <short_desc>[w] component specifier in date/time formatting is ill-specified</short_desc>
          <delta_ts>2013-05-21 15:51:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul J. Lucas">paul</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>alb.w3c</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84815</commentid>
    <comment_count>0</comment_count>
    <who name="Paul J. Lucas">paul</who>
    <bug_when>2013-03-22 02:20:33 +0000</bug_when>
    <thetext>Section &quot;9.8.4.1 The picture string&quot; of the format date/time functions includes the [w] specifier that means &quot;week in month.&quot;  Additionally, the test format-dateTime-011 uses [w] in conjunction with the ISO calendar.

However, the ISO 8601 specification has no notion of &quot;week in month&quot; (it only has the notion of &quot;week in year&quot;).

Somewhat related, the C function strftime(3) also has no conversion specification for &quot;week in month.&quot;

Hence, [w] has no precise meaning for ISO 8601 or in general.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84833</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-03-22 09:49:26 +0000</bug_when>
    <thetext>Yes, I agree it&apos;s problematic. In my XSLT 2.0 book I say &quot;ISO 8601 does not define a numbering for weeks within a month. You will have to see what your implementation returns&quot;.

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&apos;s implementation-defined whether [w] is supported

(d) withdraw or deprecate it

I&apos;m going to specifically ask for XSL WG discussion of this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85096</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2013-03-28 15:49:04 +0000</bug_when>
    <thetext>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 &quot;week of the month&quot; varies even greater than the first week of the year definitions.

Here&apos;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&apos;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&apos;t see any harm in keeping it around, though a note on its underspecification in ISO 8601 might be a good idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85863</commentid>
    <comment_count>3</comment_count>
    <who name="Anders Berglund">alb.w3c</who>
    <bug_when>2013-04-10 13:07:37 +0000</bug_when>
    <thetext>The XSLT WG discussed this at the 2013-03-28 telcon.

A &quot;w&quot; specifier is found in many programming language function
libraries and environments [notably it is included in Java].

The consensus was to keep the &quot;w&quot; specifier and specify the semantics.

Proposed changes to F&amp;O:

- In the last item in the list:

&quot;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&quot;

add &quot;first week of the month&quot;.

- After the paragraph following the list (starting &quot;Where appropriate...&quot;)
add a paragraph:

&quot;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&apos;s Thursday.&quot;

- In addition it seems to make sense to move the reference to
ISO 8601 from non-normative to normative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85929</commentid>
    <comment_count>4</comment_count>
    <who name="Paul J. Lucas">paul</who>
    <bug_when>2013-04-11 05:02:05 +0000</bug_when>
    <thetext>And what does [w] mean for non-ISO calendars?  For example, the &quot;AD&quot; calendar?  You ought to define what [w] means at least for the &quot;AD&quot; calendar since that&apos;s the most common other calendar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85946</commentid>
    <comment_count>5</comment_count>
    <who name="Anders Berglund">alb.w3c</who>
    <bug_when>2013-04-11 14:57:43 +0000</bug_when>
    <thetext>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 &quot;AD&quot; calendar) is commonly either Sunday or
Monday and we cannot mandate either to be used.

Only the ISO &quot;calendar&quot; is precicesly defined and includes a
definitionb of &quot;W&quot; - week in year. Thus it is appropriate for F&amp;O
to include a definition of &quot;w&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86541</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-04-23 11:32:39 +0000</bug_when>
    <thetext>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 &lt;code&gt;w&lt;/code&gt;
               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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88004</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-05-21 15:51:24 +0000</bug_when>
    <thetext>The text has been agreed (and is present in the new CR published today).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>