Mark Davis ☕
mark at macchiato.com
Thu Sep 13 15:48:30 PDT 2012
I really was not very clear about what I think; sorry for rambling a bit.
Yes, I agree that the best result for Gregorian is to have correct era
support, which means there is no year zero: you have 2 AD, 1 AD, 1 BC, 2
*— Il meglio è l’inimico del bene —*
On Thu, Sep 13, 2012 at 1:38 PM, Norbert Lindenberg <
ecmascript at norbertlindenberg.com> wrote:
> The output of Date.prototype.toLocaleString and
> DateTimeFormat.prototype.format is also intended for normal people, not for
> techies. So why should we introduce a year 0 for them?
> On Sep 13, 2012, at 13:31 , Mark Davis ☕ wrote:
> > In ICU, we are using Gregorian eras (AD/BC) as customarily interpreted,
> and there is no year zero. There isn't a simple way to get non-era
> years—and that form is mostly interesting to techies, not normal people,
> which is why we support the era form.
> > (If someone wanted to do it, you could probably get reasonable results
> by taking the input date, parsing with a calendar, and if the year < 1, set
> the year field to 1-year, get the date pattern for the locale, get the
> number pattern for a negative integer in the locale, insert the
> prefix/suffix around the year field in the date pattern, and format the
> Calendar date. That's be a dozen or two lines of code, but would need some
> extra code for exceptions.)
> > Mark
> > — Il meglio è l’inimico del bene —
> > On Thu, Sep 13, 2012 at 8:40 AM, Norbert Lindenberg <
> ecmascript at norbertlindenberg.com> wrote:
> > On Sep 13, 2012, at 6:55 , Andrew Paprocki wrote:
> > >>>> and Explorer formats it as being in the year 1 BC. Safari
> calculates the day
> > >>>> according to the Julian calendar, all others use the proleptic
> > >>>> calendar.
> > >
> > > That is very surprising to me. Can anyone comment on why Safari chose
> > > that implementation?
> > Probably because that's the default used for date and time formatting in
> ICU. ICU can be made to use a proleptic calendar by setting the Gregorian
> cutover to the beginning of time; I don't see an easy way to make it
> introduce a year 0.
> > Norbert
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss