Extension:TimeZonePicker

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
TimeZonePicker
Release status: experimental
TimeZonePicker screenshot.png
Implementation User interface, Ajax
Description Timezone selection map for Special:Preferences
Author(s) Brion Vibber (Brion VIBBERtalk)
MediaWiki 1.18+
License GPLv2
Download Template:WikimediaDownload/svn
Hooks used
BeforePageDisplay
Translate the TimeZonePicker extension if it is available at translatewiki.net
Check usage and version matrix.

Time Zone Picker adds an experimental time zone picker map to Special:Preferences' date/time panel.

PHP's date-and-time functions pass through latitude and longitude coordinates from the system timezone database, which we use here to plot on a map.

To prune things down, only zone settings that match the currently selected offset are shown on the map; this lets us show what likely candidates are available that match either the configured server offset or the browser settings, then pick one from the map. (This pruning implements a form of my feature request in bugzilla:16763)

Selecting a new setting (a specific zone or the server, guess, or other options) from the drop-down updates the map automatically, and centers the view on the selected offset.

The map can be zoomed in 2x by double-clicking; this may require vertical scrolling in some instances.


Note on the location information: we do not have boundaries available, and even if we did it wouldn't be wise to use them as borders are in dispute in a number of countries. Available locations are for the cities that are representative.

The map has a shading overlay that highlights a fairly generic range that approximates the size of a time zone.

Installation[edit]

To install this extension, add the following to LocalSettings.php:

require_once("$IP/extensions/TimeZonePicker/TimeZonePicker.php");

Configuration[edit]

There are no configuration options.

Development[edit]

While the master code for this extension lives in Wikimedia's SVN repository, I also have a git repo where I may have some experimental branches:

 http://gitorious.org/mediawiki-timezonepicker

Known bugs[edit]

  • doesn't pick server mode right
  • doesn't check for compatibility -- almost certain not to work right on IE6
  • double-click to zoom can select something you didn't intend to
  • it's hard to distinguish lots of items close together in some areas like Europe and the Caribbean, even in the 2x zoomed map

Todo[edit]

  • pretty sure server default isn't being handled right if not UTC
  • clean up rambling code
  • find a cleaner way to get non-current items showing (can show them but it makes the map much busier)
  • redo the map refreshes so we're not removing and recreating everything when you click something already on the map!
  • make map zoom work on iPad (?)
  • show the TZ offset in HH:MM clearly at the top of the map, with selectors to jump over to other zones for browsing :D
  • South Pole entry is still a little off
  • scroll automatically in zoomed mode
  • clearer controls for zoom
  • (perhaps) use geolocation info to help pick something