Page MenuHomePhabricator

Show localised timestamp on wiki pages such as program pages
Open, Needs TriagePublic


For wiki pages which show when something happens (such as conference program pages), the timestamps should be available in the local time of the reader.

There are various options to achieve that:

Screenshot 2021-05-22 at 13.27.54.png (326×420 px, 32 KB)

Event Timeline

Seems both more complicated and less user-friendly than just showing the times in the user's timezone. The deploy calendar on Wikitech has code for that (also for highlighting the event that's happening currently); also had some sort of gadget.

Woah, knew this would be solved better like that. Thanks @Tgr. Probably something we should do next time then.

Nice finding! Dropping it here: says

Want this schedule in your local timezone? Visit Special:MyPage/common.js, add importScript('User:Enterprisey/schedule-local-time.js'); (link) on a new line at the bottom, save, and then reload this page.

Wonder whether that should be listed on or and decline this task as it didn't happen for the 2021 Hackathon?

Ideally, we'd use such a tool for all Wikimedia events, not just the hackathon. Not sure if we have a central list for conference tools.

I think turning something like @APerson's user script into a gadget and making it relatively easy to enable on schedule pages would be ideal. The only better thing would be building the js functionality into MediaWiki or an extension natively (which I would also support). With already built this would make a nice combination. The template output could be tweaked to make some microformat for the gadget to read too if needed.

(Mark times up with <time>, very easy to do things like hover overs then.)

(Mark times up with <time>, very easy to do things like hover overs then.)

Great idea! I've done that in

Support making a gadget. Requires some design & implementation effort and I'd be happy to help out.

Tgr renamed this task from Show zonestamp localised timestamp on hover in wiki pages to Show localised timestamp on wiki pages such as program pages.Jun 2 2021, 9:16 PM
Tgr updated the task description. (Show Details)

Poor person's link if no-one implements this until next event™:

I came back to this task today because of wanting local times displayed on the schedule. I added the <time/> wrapper to the [[Template:Zonestamp]] output there and also added class="zonestamp".

This makes it possible to use a "simple" bit of code in the user's common.js to show all of the zonestamp links on the page in your local time:

wikimania:User:BDavis (WMF)/zonestamp.js
 * Display times wrapped in [[Template:Zonestamp]] as local times.
 * License: CC0
mw.hook("wikipage.content").add(function () {
	document.querySelectorAll("time.zonestamp").forEach(function (e) {
		e.textContent = new Date(e.dateTime).toLocaleString();
wikimania:User:BDavis (WMF)/common.js
mw.loader.load( "/w/index.php?title=User:BDavis_(WMF)/zonestamp.js&action=raw&ctype=text/javascript" ); // Backlink: [[User:BDavis (WMF)/zonestamp.js]]