[threeten-dev] Pattern letters
Xueming Shen
xueming.shen at oracle.com
Thu Dec 13 21:00:47 PST 2012
The pattern letter system is perfect when the format patterns are those
year/month/day/hour/minute/second date/time elements, such as "yyyy"
"MM dd" or "hh:mm:ss". But it starts to become somewhat strange when
various different date/time elements get added and various "styles" get
introduced, especially you have to list 9 letters for the nano world and 5
pattern letters but for "narrow form", sometime you will have to say "what
the...". Given my j.u.Formatter background, just wonder if it is
considerable
to add some new syntax to the system, for example let's reserve the { and }
pair for various format flag, widht, precision an/or styles
{[flags][width][.precision][narrow|short|full]]|
narrow, short and full can be the reserved/accepted style name for text,
for example E{short} for EEE, E{full} for EEEE and E{narrow} for EEEEE.
Personally I feel H{2.2} looks better than the "ppH", and it's
attractive to have
"-" as the left-justified flag:-)
Understand it's a "culture" difference, and understand it's perfect to
count the
number of pattern letters to have a real "feeling" how the output might look
like in most(?) of the cases, but just wonder it might be
convenient/cool to have
a mixed culture pattern system. We have reserved [ and ] anyway and it's
just an
addition.
It's compatible with neither jdk's existing pattern, nor CLDR though:-)
-Sherman
More information about the threeten-dev
mailing list