Jump to content

User:Anomie/lastmod

From Wikipedia, the free encyclopedia

This script will display "last modified" information at the top of the page, at the right just under the page title.

Usage

[edit]

Add the following to your common.js:

importScript('User:Anomie/lastmod.js'); // Linkback: [[User:Anomie/lastmod.js]]

Configuration

[edit]

Setting certain variables will change the operation of the script:

  • window.LastModRelative=true; will cause it to display something like "Last modified X days, Y hours ago" rather than "Last modified February 30, 2009 at 12:34".
  • window.LastModDateFormat="mdy"; will display the date in MDY order. "dmy" will display it in DMY order, and anything else will result in YYYY-MM-DD order.
  • window.LastModUseUTC=true; will display the time in UTC rather than in your browser's local time.
  • window.LastModMonths may be changed to change the displayed month names. For example, LastModMonths=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; would use abbreviated month names.
  • The text is wrapped in a span with class "lastmodheader". You can add CSS rules to your user stylesheet to override the defaults from User:Anomie/lastmod.css.

Caveats

[edit]

This script may conflict with the display produced by {{coord}}, or other scripts that place something in that position.