classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] RFC822 formatting for java.text.SimpleDateFormat


From: Andrew John Hughes
Subject: [cp-patches] RFC822 formatting for java.text.SimpleDateFormat
Date: Sun, 23 Jan 2005 02:11:14 +0000
User-agent: Mutt/1.5.6+20040907i

I'm committing the attached patch which allows the java.text.SimpleDateFormat
class to format, as well as parse, the Z pattern (RFC822 timezones).
I noticed that the locale information for this was out of sync with the
CLDR data.  Are we pulling the pattern characters from there?  All but
the base, en and nl are using the 24 character sets, so I assume some
are.

I've added the additional fields to java.text.DateFormat as GNU extensions.
'Z' is supported by Sun, but there is no field position for it, oddly.
The others aren't.  Our set now matches that given in the CLDR documentation,
although formatting and parsing support currently only exists for Z.

Changelog:

2005-01-23  Andrew John Hughes  <address@hidden>

        * gnu/java/locale/LocaleInformation.java:
        Extended localPatternChars string to match root.xml.
        * gnu/java/locale/LocaleInformation_en.java:
        Removed invalid localPatternChars string.
        * gnu/java/locale/LocaleInformation_nl.java:
        Likewise.
        * java/text/DateFormat.java:
        Documented pattern character offset constants and
        added new ones.
        (Field): Added new static fields for new pattern chars.
        * java/text/SimpleDateFormat.java:
        (CompiledField): Changed name of FieldSizePair class
        to CompiledField after adding the character as an
        attribute.  Changed fields to private and added
        accessors to give encapsulation.
        (CompiledField.CompiledField(int,int,char)): Extended
        with character field.
        (CompiledField.getField()): New accessor method.
        (CompiledField.getSize()): New acceessor method.
        (CompiledField.getCharacter()): New accessor method.
        (CompiledField.toString()): Added primarily for debugging.
        (standardChars): Now uses extended 24 character sequence.
        (compileFormat(String)): Changed to use CompiledField.
        (formatWithAttribute(java.util.Date, gnu.java.text.FormatBuffer,
        java.text.FieldPosition)): Changed to use CompiledField.
        New handler for RFC 822 timezones added.

-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

No software patents in Europe -- http://nosoftwarepatents.com

"Value your freedom, or you will lose it, teaches history. 
`Don't bother us with politics' respond those who don't want to learn." 
-- Richard Stallman

"We've all been part of the biggest beta test the world has ever known --
Windows" 
-- Victor Wheatman, Gartner

Attachment: dateformat-04.diff
Description: Text document

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]