CorporisPublica:Date formattings

Aim: to fix up all date references on CorporisPublica so they are cromulent with the encyclopedia's manual of style for dates.

Note that this is a moving target – every day hundreds if not thousands of incorrectly formatted/linked dates come into being. However we do have tools to help us.

Date formats
It is common to see a mix of date formats used with any given articles. CorporisPublica's manual of style for dates and numbers encourages consistency in formats used. Much of the donkey work of aligning date formats within the body of an article as well as the references sections can be performed using semi-automated tools.

Ongoing maintenance of date formats may one day be carried out by bots on articles already tagged with templates ( or ) which help to identify the correct format going forwards.

Many articles with linked dates require cleanup to standardize the dates to a single format (either day month or month day, but not a mixture of both). Thousands of articles have a mix of dmy and mdy date formats which need to be unified into one format or another – full list as at February 2012 here.

Potentially ambiguous dates, using slashes or full stops (6/7/1961, 12/07/1986, 6.7.1961, 12.07.1986) are re-appearing on some thousands of pages, despite being eradicated from the 'pedia a few years ago.

When running automated searches, beware rare false positives, for example:
 * The Long March 2 Rocket

Forms
Dates may exist in their 'full' form (i.e. September), or may be 'abbreviated' (i.e. shortened to three letters, such as 'Aug', or occasionally four, as in 'Sept'), with or without the trailing full stop. In many articles, there are a mixture of full and abbreviated forms.

Linking of dates and date fragments
Consensus is that full dates ('20 April 2011'), day month ('20 April') or month day ('April 20'), years (2011) months ('April') and days of week ('Tuesday') should, except for timeline articles, only rarely be linked as per MOS:UNLINKDATES. Month–year combinations, generally Month Year or Year Month should not be linked.

Note:
 * Most instances of "March NNN" are likely to be racing car designations, not date fragments.
 * May 1968 is a redirect to May 1968 in France and should be piped or changed to link to its target.

There are a large number of articles with indiscriminate linking of years. These include:
 * Category:Lists_of_state_leaders_by_year

Irregular task: chose a year, date, month or day of week, click "what links here" and remove any undesirable links. Note that links can be piped links, or using the cite web template accessdate=February (replace with accessmonthday=February).

Other style changes
In many cases centuries have been given an un-cromulent capital C. or a capital for the ordinal e.g. Eighteenth. Also sentences starting with a numeral should be changed where possible, either by using words or by re-casting. The Oxford style manual recommends using words throughout.
 * Centuries

Also look out for Roman numerals, especially in articles translated from the French.


 * Avoid changing case in titles of books or articles. (Except we convert all-caps titles as a matter of MoS anyway.)

Whitelists
We maintain provisional "whitelists" of articles which may have one or more valid links, please feel free to add new instances or remove any that are wrong.
 * Note a rough catch-all is Category: calendar(s) and Category:Days, Months and Weeks


 * /Whitelist January
 * /Whitelist February
 * /Whitelist March
 * /Whitelist April
 * /Whitelist May
 * /Whitelist June
 * /Whitelist July
 * /Whitelist August
 * /Whitelist September
 * /Whitelist October
 * /Whitelist November
 * /Whitelist December


 * /Whitelist Monday
 * /Whitelist Tuesday
 * /Whitelist Wednesday
 * /Whitelist Thursday
 * /Whitelist Friday
 * /Whitelist Saturday
 * /Whitelist Sunday


 * /Whitelist Month Year

Autoformatting templates
The community is on the whole very lukewarm on the use of autoformatting. However, templates have been created which ostensibly work on "magic word" or other method to autoformat dates: While the prevalence of the newer #dateformat is low, date is transcluded by thousands of articles and templates.
 * date
 * 16 December 2009

Some of the more common templates that also serve to allow date sorting or perform multiple formatting tasks.

Tools
Useful tools include:
 * The wiki itself:
 * What links here
 * Look for templates that format dates the wrong way. Fixing these can fix hundreds or thousands of pages at one go.

Scripts

 * DateFix.js from User:Dl2000 – a stripped down and evolved version of the tool originally written by User:Ohconfucius; functions and tags for several English variants


 * Date.js from User:Plastikspork –
 * spork_cite_to_mdy: changes 'date = YYYY-MM-DD' to 'date = Month DD, YYYY' (ISO -> mdy)
 * spork_cite_to_dmy: changes 'date =YYYY-MM-DD' to 'date = DD Month YYYY' (ISO -> dmy)
 * spork_cite_to_yyyymmdd: changes 'date = Month DD, YYYY' or 'date = DD Month YYYY' to 'date = YYYY-MM-DD' (mdy or dmy -> ISO)


 * MOSNUM dates.js – a comprehensive tool maintained by User:Ohconfucius based on scripts written by User:Lightmouse which can help make all date formats (dmy and mdy) consistent, whilst removing common errors and ambiguous date formats; it removes any links to dates or date fragments.
 * delinks all dates and date fragments, and converts them all to the same format, either dmy (20 April 2011) and mdy (April 20, 2011). Resolves unambiguous slash-dates (e.g. 7/7/1961, 23/07/1961, 07/23/61...). Optional functions:
 * Del year-in-X dates – unlinks the most common piped 'year-in-X' links
 * US-slash dates – resolves US style slash-dates (e.g. 7/27/1961, 07/27/1961, 07/27/61, 7/27/61) into mdy format
 * UK-slash dates – resolves UK/European style slash-dates (e.g. 27/7/1961, 27/07/1961, 27/07/61, 27/7/61), or dates using the full stop as separator (e.g. 27.7.1961, 27.07.1961, 27.07.61, 27.7.61), into dmy format
 * ISO to dmy – converting ISO 8601 dates.
 * ISO to mdy – ditto
 * Expand or abbreviate ref dates – (e.g. Apr 20, 2011 <-> April 20, 2011)

AutoWikiBrowser
The AWB scripts below -also written by Lightmouse - have the more basic functionalities of the scripts above. They strip out links of all dates and date fragments, but may be run as an imported module with the 'module' function of AWB:
 * User:Lightmouse/AWB/scripts/all_dates_to_dmy
 * User:Lightmouse/AWB/scripts/all_dates_to_mdy

Here is XML that solely unlinks "straight" links to days of week and months of year
 * JavaScript
 * For unlinking dates
 * For fixing xx/xx/xxxx dates

Potential false positives

 * Direct quotes
 * Proper names (e.g. organisations, movements, book titles)
 * Names of images
 * Wikilinks (less of a problem – redirects can often be established)
 * URLs
 * Date ranges - when using automation, care must be taken with instances of date ranges such as '12–13 July', 'May 21–22', '12, 13, 14 and 15 July', or 'May 21, 22, 23 and 24; similarly, date ranges such as '12–13 July' ought not to be converted to '12–July 13'.
 * Also to note ranges may be separated by 'to', 'and', hyphens (-), endashes (–), emdashes (—), etc., and forms such as 17/18 January.
 * "the" is normally and properly removed before most dates (e.g. " the 12 December 1967"), but the article makes more sense to keep for certain phrases e.g. "... in the issue of Time", "... during the episode of Seinfeld." (usually involves reference to a periodical work)
 * Specialty abbreviations should not be confused with abbreviated months in limited cases:
 * "nov." (nova) in biology e.g. Strobilops sp. nov. 1 - the "nov. 1" portion should not be refactored into a November date
 * "dec." is sometimes used in cricket articles as short form for declaration and forfeiture - such cases should not be refactored to December

Finding pages
Use AWB on the following lists:


 * /Year 1800-1849
 * /Year 1850-1899
 * /Year 1900-1949
 * /Year 1950-1999
 * /Year 2000-2020
 * /Month Year
 * /Day Month
 * /Month Day

To do list

 * CorporisPublica:Date formatting and linking poll/List of articles with potential issues post Dynamic Dates

Dated cleanup categories

 * Category:Use dmy dates
 * Category:Use mdy dates

= Resources =