W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2009

[whatwg] Historic dates in HTML5

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 5 Mar 2009 06:55:31 -0600
Message-ID: <dd0fbad0903050455u56e7d5a6u1b145e7fbdab49af@mail.gmail.com>
On Thu, Mar 5, 2009 at 6:16 AM, Philip Taylor <excors+whatwg at gmail.com> wrote:
> But given HTML5's restrictions against BCE years, they'd actually have
> to write something more like:
>
> ?if ($t->getYear() > 0) { # (be careful not to write ">= 0" here)
> ? ?print "<time class=time
> datetime=".$t->toISO8601Date().">".$t->toLocalisedHumanReadableDate()."</time>";
> ?} else {
> ? ?print "<span class=time>".$t->toLocalisedHumanReadableDate()."</span>";
> ?}
>
> and make sure their stylesheets use the selector ".time" instead of
> "time", to guarantee everything is going to work correctly even with
> unexpected input values.
>
> So the restriction adds complexity (and bugs) to code that wants to be
> good and careful and generate valid markup.

They may have to do so if they reasonably expect their dates to cross
the 0 demarcation.  The intended uses of <time> will *not* be expected
to do so.  For example, someone writing a calendar app can safely
assume that any and all dates they have to deal with are within the
appropriate era.

~TJ
Received on Thursday, 5 March 2009 04:55:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:47:49 GMT