[threeten-dev] Localized GMT offset
Xueming Shen
xueming.shen at oracle.com
Tue Mar 26 11:08:57 PDT 2013
On 03/26/2013 04:17 AM, Stephen Colebourne wrote:
> I think we're on the right lines here.
>
> I think that TextStyle makes more sense than FormatStyle, but does
> CLDR have an opinion?
I picked FormatStyle mostly because (1) the "appendLocalized()" uses FormatStyle
and (2) FormatStyle has a "long" instead of the "full" in text style. I don't have a
strong feeling about this one, either works fine with me.
> Some descriptive text about pattern letter O and Z needs adding to
> DateTimeFormatter.class Javadoc.
Added. Those got lost during merging...
> The text in the table should be "localized zone-offset" not
> "zone-offset prefixed"
Fixed.
> Is there any way to re-use the main offset ID internal class to avoid
> the duplicated code?
I might be possible, but it appears to make the implementation a little messy, so
I go with the "clean" and separate one.
> You've included seconds in the format/parse when CLDR does not. I
> think tats the right choice, but its worth noting.
>
it appears CLDR also specifies the "optional second" in both long and short forms, just
not listed in example.
*Localized GMT format:*A constant, specific offset from GMT (or UTC), which may be in a translated form. There are two styles for this. The first is used when there is an explicit non-zero offset from GMT; this style is specified by the <gmtFormat> element and <hourFormat> element. The long format always uses 2-digit hours field and minutes field, with optional 2-digit seconds field. The short format is intended for the shortest representation and uses hour fields without leading zero, with optional 2-digit minutes and seconds fields. The digits used for hours, minutes and seconds fields in this format are the locale's default decimal digits:
* "GMT+03:30" (long)
* "GMT+3:30" (short)
* "UTC-03.00" (long)
* "UTC-3" (short)
* "????????+03:30" (long)
> TCKOffsetPrinterParser, TCKDateTimeFormatterBuilder and
> TestDateTimeFormatterBuilder should have an invalid pattern for 6 Z.
>
updated.
Latest webrev
http://cr.openjdk.java.net/~sherman/jdk8_threeten/fmtOffsetPrefixed/
thanks,
-Sherman
More information about the threeten-dev
mailing list