Hi,
I have made an extension called AllTimeZones [1] that lets anyone put up dates in a page in all Timezone formats. I think it will be especially useful for admins when announcing a meeting rather than the current usage I saw at http://meta.wikimedia.org/wiki/Wikidata/Events (using the Template:UTC with local time link) as I don't like the idea of opening a new website just to check my local time.
Reedy already suggested to make the zones in UTC format (I am still working at it), any other comments are most welcome. The UI really needs some work IMHO. You can see its screenshot at [2].
[1]http://www.mediawiki.org/wiki/Extension:AllTimeZones [2]https://github.com/nischayn22/AllTimeZones/raw/master/timezone.png
Interesting idea - I've seen something similar done with templates.
Any interest in hosting this on WM's Git installation rather than github?
-greg aka varnent
On Apr 3, 2012, at 11:12 PM, nischay nahata nischayn22@gmail.com wrote:
Hi,
I have made an extension called AllTimeZones [1] that lets anyone put up dates in a page in all Timezone formats. I think it will be especially useful for admins when announcing a meeting rather than the current usage I saw at http://meta.wikimedia.org/wiki/Wikidata/Events (using the Template:UTC with local time link) as I don't like the idea of opening a new website just to check my local time.
Reedy already suggested to make the zones in UTC format (I am still working at it), any other comments are most welcome. The UI really needs some work IMHO. You can see its screenshot at [2].
[1]http://www.mediawiki.org/wiki/Extension:AllTimeZones [2]https://github.com/nischayn22/AllTimeZones/raw/master/timezone.png -- With Regards
Nischay Nahata B.tech 3rd year Department of Information Technology NITK,Surathkal _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
This is a really useful solution. Thanks Nischay!
On Wed, Apr 4, 2012 at 1:12 PM, nischay nahata nischayn22@gmail.com wrote:
Hi,
I have made an extension called AllTimeZones [1] that lets anyone put up dates in a page in all Timezone formats. I think it will be especially useful for admins when announcing a meeting rather than the current usage I saw at http://meta.wikimedia.org/wiki/Wikidata/Events (using the Template:UTC with local time link) as I don't like the idea of opening a new website just to check my local time.
Reedy already suggested to make the zones in UTC format (I am still working at it), any other comments are most welcome. The UI really needs some work IMHO. You can see its screenshot at [2].
[1]http://www.mediawiki.org/wiki/Extension:AllTimeZones [2]https://github.com/nischayn22/AllTimeZones/raw/master/timezone.png -- With Regards
Nischay Nahata B.tech 3rd year Department of Information Technology NITK,Surathkal _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- John Vandenberg
Hey,
I had a quick look at this extension and have some suggestions:
* Escape ALL variables in HTML you are building. You can use htmlspecialchars, the methods of MediaWikis HTML class, and in this case probably want to just construct the whole thing with XmlSelect.
* You are not fully following the style guidelines. The spacing is off and you are using underscores in var names instead of lowerCamelCase. See http://www.mediawiki.org/wiki/Manual:Coding_conventions
* Don't use the 'description' in wgExtensionCredits, use 'descriptionmsg' instead, and properly internationalize it.
Next to that it looks great, although I'm not completely sure the i18n is all in order when using the native PHP time functions :)
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. --
Thanks everyone for your feedback
On Wed, Apr 4, 2012 at 10:58 PM, Jeroen De Dauw jeroendedauw@gmail.comwrote:
Hey,
I had a quick look at this extension and have some suggestions:
- Escape ALL variables in HTML you are building. You can use
htmlspecialchars, the methods of MediaWikis HTML class, and in this case probably want to just construct the whole thing with XmlSelect.
- You are not fully following the style guidelines. The spacing is off and
you are using underscores in var names instead of lowerCamelCase. See http://www.mediawiki.org/wiki/Manual:Coding_conventions
- Don't use the 'description' in wgExtensionCredits, use 'descriptionmsg'
instead, and properly internationalize it.
Next to that it looks great, although I'm not completely sure the i18n is all in order when using the native PHP time functions :)
Yes, you are right. I have only spend about 5-7 hours in making that extension and was too excited to mail the list. It needs a lot of cleanup and i18n and some better UI also. I will also change the var names.
Besides that I also look forward to make a general extension to handle conversion of units for length,weight etc
There already is such unit conversion code. In parserFunctions extension IIRC :)
Sent from my Android phone.
On Wed, Apr 4, 2012 at 11:55 PM, Jeroen De Dauw jeroendedauw@gmail.comwrote:
There already is such unit conversion code. In parserFunctions extension IIRC :)
Thanks for pointing that out. I wonder if such unit conversion should also be displayed with an option to convert by the user who is viewing it. Not a Select list but some fancy JS thing maybe.
On Tue, 03 Apr 2012 20:12:57 -0700, nischay nahata nischayn22@gmail.com wrote:
Hi,
I have made an extension called AllTimeZones [1] that lets anyone put up dates in a page in all Timezone formats. I think it will be especially useful for admins when announcing a meeting rather than the current usage I saw at http://meta.wikimedia.org/wiki/Wikidata/Events (using the Template:UTC with local time link) as I don't like the idea of opening a new website just to check my local time.
Reedy already suggested to make the zones in UTC format (I am still working at it), any other comments are most welcome. The UI really needs some work IMHO. You can see its screenshot at [2].
[1]http://www.mediawiki.org/wiki/Extension:AllTimeZones [2]https://github.com/nischayn22/AllTimeZones/raw/master/timezone.png
We actually already have some plans on how to handle this case: The intent is to support the html5 <time> element. - <time> will be allowed in WikiText. - When a certain attribute is specified time will automatically be localized by JS using the user's preferences, a cookie, or their browser settings. - We will have a parser function that formats time into contentlang and outputs a <time> with said attribute.
Relevant bugs: - https://bugzilla.wikimedia.org/show_bug.cgi?id=32545 - MediaWiki should support <time> in WikiText - https://bugzilla.wikimedia.org/show_bug.cgi?id=19992 - Support client-side date/time formatting for user's local timezone (JavaScript) - https://bugzilla.wikimedia.org/show_bug.cgi?id=30857 - Requesting more user-friendly timestamps
I've introduced a changeset that adds support for <time> in WikiText: - https://gerrit.wikimedia.org/r/#change,4251
I also wrote some code for parsing the datetime="" of a <time> element.
The next step would probably be porting our Language::sprintfDate and other date related methods to our JS mw.language system.
After that we'd incorporate it into the jQuery.fn.formatTime code I also have partially written. And start handling the preferences and cookies.
Then we'd probably add in the parser function and relative time code.
When we're done with that stuff we can probably come up with a good user interface to make out of that.
Here's my thought on that right now: - The timezone portion of the output becomes a stylized button (probably not directly <button> but a css style that's button-ish) - Clicking on the button brings up a timezone map (a nice intuitive one with a real map) - When you change the timezone it will either use the api to change your user preference or set either a localStorage key or cookie (cookies have the domain advantage, while localStorage has the "not sending pointless cookies" and StorageEvent advantages).
We'll also want to come up with a good switching ui for https://bugzilla.wikimedia.org/show_bug.cgi?id=30857
On Thu, Apr 5, 2012 at 1:05 AM, Daniel Friesen lists@nadir-seen-fire.comwrote:
We actually already have some plans on how to handle this case: The intent is to support the html5 <time> element.
- <time> will be allowed in WikiText.
- When a certain attribute is specified time will automatically be
localized by JS using the user's preferences, a cookie, or their browser settings.
- We will have a parser function that formats time into contentlang and
outputs a <time> with said attribute.
Relevant bugs:
- https://bugzilla.wikimedia.**org/show_bug.cgi?id=32545https://bugzilla.wikimedia.org/show_bug.cgi?id=32545- MediaWiki should support <time> in WikiText
- https://bugzilla.wikimedia.**org/show_bug.cgi?id=19992https://bugzilla.wikimedia.org/show_bug.cgi?id=19992- Support client-side date/time formatting for user's local timezone
(JavaScript)
- https://bugzilla.wikimedia.**org/show_bug.cgi?id=30857https://bugzilla.wikimedia.org/show_bug.cgi?id=30857- Requesting more user-friendly timestamps
I've introduced a changeset that adds support for <time> in WikiText:
I also wrote some code for parsing the datetime="" of a <time> element.
The next step would probably be porting our Language::sprintfDate and other date related methods to our JS mw.language system.
After that we'd incorporate it into the jQuery.fn.formatTime code I also have partially written. And start handling the preferences and cookies.
Then we'd probably add in the parser function and relative time code.
When we're done with that stuff we can probably come up with a good user interface to make out of that.
Here's my thought on that right now:
- The timezone portion of the output becomes a stylized button (probably
not directly <button> but a css style that's button-ish)
- Clicking on the button brings up a timezone map (a nice intuitive one
with a real map)
- When you change the timezone it will either use the api to change your
user preference or set either a localStorage key or cookie (cookies have the domain advantage, while localStorage has the "not sending pointless cookies" and StorageEvent advantages).
We'll also want to come up with a good switching ui for https://bugzilla.wikimedia.**org/show_bug.cgi?id=30857https://bugzilla.wikimedia.org/show_bug.cgi?id=30857
-- ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
______________________________**_________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.**org MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/mediawiki-lhttps://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Nice to know there is already work going on in this, it seems to me as a very important feature.
I have made necessary changes to this extension as per the MW coding guidelines and Jeroen's advise. It is now in a stable state, if someone wants to use it (till the <time> element is not supported in WikiText). However, I still haven't got the space in WM's Git installation to host it. Hope to get it soon.
mediawiki-l@lists.wikimedia.org