This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29616 - [QT3] format-date-044
Summary: [QT3] format-date-044
Status: RESOLVED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-07 21:33 UTC by Benito van der Zander
Modified: 2016-05-10 14:17 UTC (History)
2 users (show)

See Also:


Attachments

Description Benito van der Zander 2016-05-07 21:33:45 UTC
In format-date-044 format "[Y#.0,2]" has width formatter "2" which has no max width, and thus should not truncate the year
Comment 1 Josh Spiegel 2016-05-08 18:22:56 UTC
This was added to test comment 10 of bug 29555.  In this case, year should be truncated.  Closing as invalid but you can reopen if you disagree after reviewing the comment.
Comment 2 Benito van der Zander 2016-05-08 20:04:07 UTC
>(i) if the width modifier is present and includes a maximum width,

I was thinking if the modifier is there, then it always has an implicit maximum.
Comment 3 Benito van der Zander 2016-05-10 08:59:07 UTC
It is also not clear what happens to fractions with such a format

format-time(xs:time("12:22:33.123456"), "[f#.0,2]")

The fraction truncation should probably be consistent with the year truncation
Comment 4 Abel Braaksma 2016-05-10 13:47:45 UTC
(In reply to Benito van der Zander from comment #3)
> It is also not clear what happens to fractions with such a format
> 
> format-time(xs:time("12:22:33.123456"), "[f#.0,2]")
> 
> The fraction truncation should probably be consistent with the year
> truncation
In Bug 29555, comment 3, the proposal is (and I think it was accepted) that the first presentation modifier *must* follow the pattern "\d+#*". Your pattern is therefore not allowed (the "." should not appear there and the "0" cannot follow the "#").

The proper way to express a min width of 2 would be:

format-time(xs:time("12:22:33.123456"), "[f0#,2]")

or:

format-time(xs:time("12:22:33.123456"), "[f0,2]")

or:

format-time(xs:time("12:22:33.123456"), "[f00]")

Note that the first two expressions above have a max width of infinity according to that same comment. To force a max of two digits, one has to write:

format-time(xs:time("12:22:33.123456"), "[f0#,2-2]")

or:

format-time(xs:time("12:22:33.123456"), "[f0,2-2]")
Comment 5 Benito van der Zander 2016-05-10 14:09:46 UTC
Then compare the output of
  format-time(xs:time("12:22:33.123456"), "[f00,2]")
and
  format-date(xs:date('2016-01-01'), '[Y00,2]')
Comment 6 Josh Spiegel 2016-05-10 14:17:02 UTC
Benito, if you think we need consistency in these cases, can you either file a new bug against the specification or make the comment on bug 29555?