[PATCH stable] hgweb: fix dynamic date calculation not working under Safari
timeless
timeless at gmail.com
Tue Oct 25 03:21:16 UTC 2011
Fwiw, this is what I asked for. Brodie is concerned about limiting
change in order to get a fix for stable.
On 10/24/11, Laurens Holst <laurens.nospam at grauw.nl> wrote:
> Op 24-10-2011 21:02, Brodie Rao schreef:
>> While Chrome, Firefox, and IE 6+ support the current date format being
>> passed to Date(), Safari doesn't:
>>
>>> new Date('Mon Oct 24 13:58:01 2011 +0200')
>> Invalid Date
>>
>> However, the rfc3339date format does work:
>>
>>> new Date('2011-10-24T13:58:01+02:00')
>> Mon Oct 24 2011 04:58:01 GMT-0700 (PDT)
>>
>> This change adds a new data-date attribute to all age/date elements in
>> each theme. If process_dates() sees an age element with that
>> attribute, it'll prefer it over using the element's text content.
>>
>> Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 6.0.1.
>
> Hi Brodie,
>
> ISO dates are a relatively new addition to JavaScript in ECMAScript 5
> (section 15.9.3.2) and will not work in all browsers. I can’t give you a
> breakdown, but amongst others (iirc) I know that the iOS JavaScript
> implementation can not parse it. To be honest I thought IE would have a
> problem with it as well (but I guess not).
>
> Either way, the most compatible date parsing format is RFC822 used in ES3:
>
> Mon, 25 Dec 1995 13:30:00 GMT+0430
>
> I would recommend you use this one.
>
> See:
>
> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
>
> ~Laurens
>
> --
> ~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
> Laurens Holst, developer, Utrecht, the Netherlands
> Website: www.grauw.nl. Working @ www.roughcookie.com
>
>
>
--
Sent from my mobile device
More information about the Mercurial-devel
mailing list