User:Gestrid/comments in local time

From Lotro-Wiki.com
Jump to navigation Jump to search

Comments in Local Time is a gadget that changes UTC-based times and dates, such as those used in signatures, to be relative to local time. It can also optionally add the day of the week and the difference between each date and the current date. The code is at comments in local time.js.


Installation

To install this gadget, copy the code below to your custom JavaScript skin file, which is accessible by going to your preferences and clicking the JavaScript link for whichever skin (Cologne Blue, Modern, Monobook, or Vector) is currently active:

importScript('User:Gestrid/comments in local time.js'); // [[User:Gestrid/comments in local time.js]]

Examples

00:00 1 January 2011 (UTC) is changed to 7:00 pm, 31 December 2010, Friday (1 month, 2 days ago) (UTC-5).


The date is shown in your local time, based on your computer's timezone setting. The display is highly customizable through the use of options. For instance:

00:00 1 January 2011 (UTC) can instead be changed to 19:00, December 31, 2010, (33 days ago) (UTC-5).


Dates that are either today, yesterday, or tomorrow are shown with relative dates, such as Today, 1:00 am (UTC-5).


Local time

The script draws local time for signatures from the time set on the user's computer. The time for logs and page histories is drawn from the time set in the appearance tab in each user's preferences.

Attribution

This script originally came from a user on Wikipedia here and is available under the Creative Commons Attribution-ShareAlike 3.0 Unported License. For additional options with this plugin, see that page. See this page for details on how to legally reuse this content.