When many authors from different countries use a wiki, it is annoying to see the date/time stamps in a single timezone, different from their own. For an author in Europe or in New Zealand, having the dates in the Dallas/TX timezone makes it hard to estimate when an edit was actually done.
The recipe rewrites the timestamps in RecentChanges pages and on page histories to show the time in the local timezone of each author. The original date/time string is moved to a tooltip/title and appears when the mouse cursor is positioned over the link.
For the changes from the last 24 hours, after the page entry, a "+" plus sign is appended. Clicking on it will fetch and display the authors and summaries of the changes to that page from the last 48 hours.
The recipe is now enabled on pmwiki.org, see for example Site.AllRecentChangesShort.
Copy localtimes.js to your pmwiki/pub directory. Add near the end of local/config.php such code:
Note that the installation code changed in version 20150906.
Note that LocalTimes has built-in the functionality of the recipe "Better RecentChanges" from TrackChanges, but you cannot have the two recipes at the same time. If you previously used TrackChanges, please remove its installation code from config.php.
You can configure the duration of the fetched page history.
In config.php, set
$LastTimesHours = 24; // 24 hours; default is 48
To disable the "+" plus button and the fetching of recent history, set this variable to 0:
$LastTimesHours = 0;
In a RecentChanges page, or in a Page History, you will see the timestamps in the local time zone of your operating system. Note that in RecentChanges, only pages modified after the installation of the recipe will have their timestamps localized.
Click on the "+" plus sign after a page entry to see its recent history.
The recipe expects the RecentChanges format to be in standard bulleted or numbered lists. Other formats are not supported, eg. Tables may produce unexpected results and errors.
If the skin has a <div id="wikitext"> block, the recipe will only scan links in it and will work faster. If the page heading has the class "pagetitle", the recipe will append the current local time to the heading in light gray. (The default pmwiki skin and many other skins contain these elements; you can check if your skin does.)
Change log / Release notes
- 20160515 - click on the pagetitle timestamp will now reload the page.
- 20150906 - fix "+" plus signs, no longer displayed if no more edits in 48 hours (takes effect up to 48 hours after upgrade). No more need to edit localtimes.js. Added styles for the "+" signs. Please note that the installation code changed.
- 20150830 - bug fix: escape special characters in the fetched page summaries.
- 20150804 - add Ajax fetching of recent page history.
- 20150621 - append time to pagetitle heading.
- 20121231 - minor refactoring, changes from less than 24 hours show just the time.
- 20121109 - changed today's changes to show just the time.
- 20110607 - fix tooltip titles in Internet Explorer.
- 20110605 - first public release, ready to be tested.
- Petko is author and maintainer of this recipe (5ko [snail] 5ko [period] fr).
- If this recipe helps you or saves you time, you can help support its continued development by ♥ .
See discussion at LocalTimes-Talk