Fandom Developers Wiki
Register
Advertisement

This is the talk page for discussing improvements to the UTCClock page.

Expanded Wiki Navigation

This code needs an update to be compatible with the New Expanded Wiki navigation. Leviathan_89 18:53, October 10, 2011 (UTC)

An example would be this code. It would be cool to have the possibility to set the timezone or the local language. Leviathan_89 19:05, October 10, 2011 (UTC)
I realise this post was made almost a year ago, but for completeness... I've adopted this script and have rewritten it so that it works with expanded nav. I haven't given it the ability to set the timezone as, IMHO, the whole point is to see the server (UTC/GMT) time; you probably already have your own clock on your computer if you use Windows or OS X, most Linux set-ups have clocks as well so the local time is not very useful. It is now possible to localise it now using a custom format string, I could set up a i18n repository in the script for default formats for multiple languages but people should be able to just alter the clock to look however they want. Lunarity 10:26, September 2, 2012 (UTC)

New feature

I'd like to have the possibility of add a custom hover message also I don't know if I miss it, but there isn't a variable to display the day name in the user's language as %B does with the month name. I can use %{Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday}w but I believe it will display only the text I choose. leviathan_89 13:36, October 3, 2012 (UTC)

  1. That's correct. It's a limitation of MediaWiki, only the Month names are available to me (wgMonthNames and wgMonthNamesShort, there isn't any wgDayNames), there's no source for the day names so I can't offer that feature at the moment. Sorry. The best I can suggest is the %x option, but that produces wildly uncontrolled output (Day name, number, year, month in the user's locale order).
  2. That's somewhat of an oversight on my part, I forgot to expose the hover text as a configuration option, it won't take long to add.
Lunarity 13:49, October 3, 2012 (UTC)
Okay, the option is called hoverText. I'll update the doc page but that'll take a few minutes. Lunarity 13:54, October 3, 2012 (UTC)

Time Zones

Is there a way to make it show a differ time other than UTC?

For instance I live in the Texas, USA (Central Standard Time or CST or UTC - 6)

Is there a way to change the hours displayed backwards by 6 hours?

-- <span=help title="J r o o k s j r" style="color:blue;">J r o o k s j r (<span=help title="See what Jrooksjr has contributed to Dev wiki.">C | <span=help title="Jrooksjr's Talk/Discussion Page.">T/D | <span=help title="Email me.">E) [[Special:Editcount/Jrooksjr|<span=help title="Jrooksjr has made Special:Editcount/Jrooksjr Contribution(s) to Dev wiki." style="font-weight:bold; background:#FAE0AE;">Special:Editcount/Jrooksjr]] contributions and counting. 23:46, March 3, 2013 (UTC)

No, sorry, the timezone isn't configurable. The purpose of this widget is to see the server time. It's aimed at making it easy to check the time in signatures on Talk pages relative to the current time, anonymous editors also see all times in UTC so it's very helpful when trying to make sense of History and Recent Changes, and it's also useful for Wikis with the achievement system active; since whenever achievements say "days", they mean UTC 00:00->23:59 is one day. UTC is also standard for coordinating an event with people across multiple timezones. It's kind of pointless otherwise since you should have a clock in local time on your computer's UI already (taskbar [Windows] / top menu bar [Mac] / "Charms" bar ["Windows" 8]). Lunarity 03:42, March 4, 2013 (UTC)
Actually, that's not very helpful if you want to coordinate based on a particular local time zone (for instance a game server in New York or Los Angeles). It won't help you when everything in the game refers to "today" or "tomorrow" as a timezone that isn't your personal local time or UTC. --Vandraedha (talk · contribs) 09:40, May 3, 2013 (UTC)
I realize this is years late, but in case anyone else drops in wondering the same thing: Though this DisplayClock isn't meant to be configurable, it's a very easy adjustment if you want to go the step of making your own copy of the .js file. Find the line in the code d.setMinutes(d.getMinutes() + d.getTimezoneOffset()); // To UTC You can then adjust the time by addition or subtraction of minutes, between those last parentheses. I wanted UTC + 9 hours, so it became d.setMinutes(d.getMinutes() + d.getTimezoneOffset() + 540); // To UTC + 540 to JST JoshuaJSlone (talk) 20:50, April 13, 2016 (UTC)

Hover Text

This Is the current hover text, why is it named regenerate the page, that seems very aimed at the Doctor Who wikia, could somebody change it to refresh?

hoverText: "Click here to make the server purge and regenerate (update) this page"
- — FarewellEleven at Wikia Developers Wiki Wiki 10:04, August 13, 2013 (UTC)
Doesn't really matter as it is customizable. ~ UltimateSupreme 10:36, August 13, 2013 (UTC)
Regenerate as in "create again". That's what purge does (or is supposed to do), I believe. ~Bobogoobo (talk) 21:57, August 13, 2013 (UTC)

Here ya go:

hoverText: "Click here to make the server purge and refresh this page"

Copy the code from [[../code.js]] to yoursite/MediaWiki:DisplayClock.js and replace the above line in the code. Then add an import statement in your MediaWiki:Common.js, such as

importArticle({
    type: 'script',
    article: [        
        'MediaWiki:DisplayClock.js'
    ]
});

RyaNayR (talk) 06:47, November 24, 2013 (UTC)

If a user is incapable of reading the documentation to realise that you can change the default message with the config options, do you really think having them keep the script on a page of their wiki where they would have to maintain it is a good idea? It's kind of the whole point behind writing scripts for other people to use here. cqm 19:20, 24 Nov 2013 (UTC)

Nice

Inspired by your documentation I tested format: '%2H:%2M:%2S %{Mon;Tues;Wednes;Thurs;Fri;Satur;Sun}uday',, and it worked like a charme. Maybe mention that DisplayClock can be used instead of PurgeButton — I only guessed this, because it was mentioned on another page and because the mw: clock gadget offers purge. –Dunnoob (talk) 04:38, December 7, 2013 (UTC)

CSS doesn't update

In Common.css I put

a#DisplayClockJS {color: green !important}

and

a#DisplayClockJS {text-align: left; color: green !important}

but nothing happens. Alysdexia (talk) 11:35, November 7, 2014 (UTC)

Common.css is not used in skin Wikia. Add the rules to Wikia.css. Arkondi (talk) 12:31, November 7, 2014 (UTC)
Um, actually it is. Monobook.css is for Monobook, Wikia.css is for Oasis, and Common.css is for both.  Digifiend  Talk  PR/SS  KR  MH  Toku  JD  Garo  TH  CG  UM  Logos  DW  01:39, 4/12/2014 
And I'm very glad that Wikia changed this. Arkondi (talk) 09:57, December 4, 2014 (UTC)

zero padding

Time numbers are not zero padded. leviathan_89 13:05, October 7, 2016 (UTC)

New header

would it be possible to adapt this to the new header? leviathan_89 20:19, May 17, 2017 (UTC)

Added. It may need minor tweaking though (at least via site-CSS). Rappy 07:20, May 18, 2017 (UTC)
Yes, the text color should be the same as plain text. Can't the CSS be added from the script itself? Also there is still the zero padding problem, which is strange because I see a "pad function" in the script, although I don't fully understand if that's its purpose. leviathan_89 11:52, May 18, 2017 (UTC)
I think I solved the color issue at least. leviathan_89 14:37, May 18, 2017 (UTC)
Anyway not to have tweaking on every wiki we see it on? Right now on CC it's not readable with the header. DEmersonJMFM 02:08, May 19, 2017 (UTC)
Advertisement