Hen,
Try this one out.
Update the code in case 'y' into this
if (tokenLen == 2) {
rule = TwoDigitYearField.INSTANCE;
} else {
rule = selectNumberRule(Calendar.YEAR, tokenLen);
}
-----Original Message-----
From: Henri Yandell [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 12, 2004 12:48 AM
To: Jakarta Commons Developers List
Subject: Re: Time bugs Was: [lang] FastDateFormat year bug
Actually, I retract this. If it switches to P'y'Y, then it won't print
out 2002 but 02 when it does large durations. I think the 'hack' of
using a DateFormat to format durations is stretched here.
So 2 problems now. Years are broke in ISO_EXTENDED and dates are broke
in FastDateFormat.
Hen
On Sun, 12 Sep 2004 00:40:51 -0400, Henri Yandell <[EMAIL PROTECTED]>
wrote:
> testISODurationFormat:
> // test fixture from example in
> http://www.w3.org/TR/xmlschema-2/#duration
> cal.set(1, 1, 3, 10, 30, 0);
> cal.set(Calendar.MILLISECOND, 0);
> text = DurationFormatUtils.ISO_EXTENDED_FORMAT.format(cal);
> assertEquals("P1Y2M3DT10H30M0.0S", text);
>
> This is, I believe, a bug in our pattern:
>
> ISO_EXTENDED_FORMAT_PATTERN = "'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'"
>
> should be:
>
> ISO_EXTENDED_FORMAT_PATTERN = "'P'y'Y'M'M'd'DT'H'H'm'M's.S'S'"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]