Does your wiki feature in-game season, battle passes, in-game events? Put this gadget on your wiki for users to track to see when a season/event starts or ends. This is a functionality gadget, so we recommend adding it as default-hidden.
Installation instructions
Note: If gadget is enabled by default, it will only apply to users who have accounts. If you'd like it to be visible to non-accounts, you will need to convert it to non-gadget and apply the .js to your MediaWiki:Common.js.
Important
Remember, JavaScript can be used maliciously; please make sure you trust the source of any JS you're copying to your wiki! A protected namespace on the wiki.gg Support Wiki should be safe, but it's still a good idea to check the version history and make sure there aren't any suspect recent changes (e.g., if someone's account was compromised).
You need to be a local/community admin on your wiki to follow these steps, since it involves editing pages in the MediaWiki namespace.
Copy the source code to your wiki. This includes the contents of the following pages:
Copy the contents of MediaWiki:Gadget-timer to your wiki. This is the translation string that will display when people look at information about the gadget, so you can modify it if needed.
At MediaWiki:Gadgets-definition on your wiki, APPEND ONE of the following three options, depending on what config option you want.
* timer[ResourceLoader|default|hidden|type=general]|timer.js = it's available to everyone with no opt-out ability (RECOMMENDED)
* timer[ResourceLoader|default|type=general]|timer.js = it's available to everyone but you can opt out in your user page
* timer[ResourceLoader|type=general]|timer.js = by default it's not turned on, but you can turn it on in settings
You may have to wait somewhere between 5 and 15 minutes at this time for server-side cache to update.
Done! Make sure you cache refresh on your browser (Ctrl+F5) on the upload page to see changes.
Templates
These templates are needed for the gadget to work properly.
PresentsUTCtime(eitherabsolutepointsorranges),localisedbyjavascriptin[[MediaWiki:Gadget-timer.js]]tothebrowser's time zone.Provide the following parameters:; date : Required - UTC Date in YYYY-MM-DD format, e.g. "2042-02-12" for the 12th of February, 2042.; start : Required - UTC Time in HH:MM 24-hour format, e.g. 23:59 for one-minute-before-midnight.; end : Optional - Interval endpoint: UTC Time in HH:MM 24-hour format.; end-date : Optional - Interval endpoint: UTC Date in YYYY-MM-DD format.; anchor : Optional - Anchor time: UTC Date/Time in YYYY-MM-DD HH:MM format.If <code>|end=</code> is not provided, a single time is displayed. If <code>|end=</code> is specified, the times are displayed as a range; <code>|end-date=</code> defaults to <code>|date=</code> if not specified.'''Important:''' start and end-points of an interval should generally be within 12 hours of each other, as the <code>end-date</code> is not displayed to the reader. The start date is displayed unless it matches the anchor time in the local time zone, or today'sdate(ifnoanchortimeisspecified).Examples::<code><nowiki>{{time|20:00|2000-01-01}}</nowiki></code>→{{time|20:00|2000-01-01}}:<code><nowiki>{{time|start=20:00|date=2000-01-01}}</nowiki></code>→{{time|start=20:00|date=2000-01-01}}:<code><nowiki>{{time|start=20:00|date=2000-01-01|end=21:00}}</nowiki></code>→{{time|start=20:00|date=2000-01-01|end=21:00}}Script/templatedesignedby[[User:Pcj]]fromhttps://warcraft.wiki.gg/wiki/MediaWiki:Common.js<onlyinclude><spanclass="jst-abstime"data-jst-time="{{{date|{{{2}}}}}} {{{start|{{{1}}}}}}"data-jst-time2="{{{end-date|{{{date|{{{2}}}}}}}}} {{{end}}}"data-jst-anchor="{{{anchor|}}}">{{{start|{{{1}}}}}}{{#if:{{{end|}}}| –{{{end}}}}}UTC</span></onlyinclude><noinclude>[[Category:Templates]]</noinclude>