https://bugzilla.wikimedia.org/show_bug.cgi?id=19992
--- Comment #2 from Brion Vibber <[email protected]> 2011-06-06 22:24:37 UTC --- Some answers to my older questions to self: * avoid document.write; we are a DOM world now, and jQuery simplifies out some of the browser-specific oddities like text vs textContent * various formatting & localization stuff is getting merged into the JS side these days, so we should make sure this is handled in some consistent-ish way * talk page signature should probably start marking up times in a machine-readable way so we can reformat those * DST stuff appears to be handled correctly; the browser's JS engine will hook into some system locale library that has all the timezone info, so it should do conversions from UTC to local time using the appropriate mode for the date the time is attached to, as long as both bits of info are there. Confirmed that Date.getTimezoneOffset() returns the offset for the target date, not the current date. The actual markup is still an open issue... one possibility is to use a data attribute: <span class="mw-ts" data-mw-datetime="20110606220634">6 June 2011 22:06:34</span> or for just date or just time: <span class="mw-ts" data-mw-time="20110606220634">22:06:34</span> <span class="mw-ts" data-mw-date="20110606220634">6 June 2011</span> With JS off, whatever the original form was goes through intact. With JS on, our handlers zip on through finding the matching ones and reformatting them. Couple issues: * as noted above, lists with date headings like RecentChanges will need special handling, since day boundaries move. * the in-browser JS APIs don't expose a symbolic name for the timezone -- we can get an offset, though, so can display like '15:06:34 (UTC-7)' though we perhaps can't reliably display '15:06:34 (PDT)'. * 'flicker' can be a problem with post-processing of timestamps; slow page loads may leave a delay between the start of the document being visible and loading & execution of code at end. Possibly we can get away with an early start for the time formatting, but access to locale info is very useful for this... -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
