On 4/29/2013 10:04 AM, Justin Mclean wrote:
This is for formatting a date in a user specified way. Issue is is some
formats (ISO standards even) drop the ":" For instance:
http://en.wikipedia.org/wiki/ISO_8601
that's peculiar for that "standard" (vs the "extended" format). i'd keep it. and
another reason why i hate user-supplied formats (AKA choice).
Guess another question is do you pad single digit hours or not - which
currently I do.
for consistency i'd pad it. and 9:9 just doesn't "look" right (not that there
ever would be a 9 minute offset BUT politicians control timezones so who knows).
And I also need to be able to able to support adding GMT in there - thanks
for point that out. Does anyone know if "GMT" is localised or is it always
"GMT"?
according to this page it can be it can be "localized" ("HUA")
http://cldr.unicode.org/translation/timezones
as well as appear after the offset (though i can't recall any locales where this
is the case).
So the possible range of values expands to: -6 -06 -0600 -600 -06:00 -6:00
GMT-06:00
or maybe even -06:00GMT
I'm think (unless anyone have better ideas) I'll reduce the format to just
"Z" and add two properties padTimeZone (default false) and timeZonePrefix
(default to ""). timeZonePrefix coudl then be set to "Z" or "GMT" as
...and maybe tz ID could come after.
and just to be clear "Z" here refers to UTC?