Jump to content

User talk:Gimmetrow/dates.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This provides tools to fix and adjust date formatting.

To install: add importScript('User:Gimmetrow/dates.js') to your monobook.js

Clear your cache to force monobook to reload. When editing a page there should be five tools in the toolbox window:

  • Format -year in X - fixes some [[2001 in XYZ|2001]] or isolated [[2005]] links
  • Format date=ISO - converts date fields with ISO-style dates to DMY
  • Format +datelinks - add links to every DM/MD/DMY/MDY date
  • =Format [[DMY]] - format all linked DM/MD dates as day month year (with space, no comma)
  • =Format [[MDY]] - format all linked DM/MD dates as month day, year (with space and comma)
  • Format -datelinks - remove all links from dates

The "-year in X" tool is useful for situations like [[January 1]], [[2001 in film|2001]]. It must be done first for the later tools to recognize the date format.

The "date=ISO" tool converts ISO formats preceeded by "date=", as in cite templates, to unlinked DMY.

The "+datelinks" tool adds links to isolated day+month, and to combinations with four-digit years. It should convert [[January 1]], 2001 to [[January 1]], [[2001]].

The DMY and MDY tools make all linked dates (with four-digit years) look like either [[January 1]], [[2001]] or [[1 January]] [[2001]]. It will add a space (and comma for MDY) to [[January 1]][[2001]]. To give text a consistent format, add every link and pick a format.

The "-datelinks" tool will remove all links. This does not work with three-digit years (isolated or with day+month).

Start a discussion about improving the User:Gimmetrow/dates.js page

Start a discussion