Content deleted Content added
mNo edit summary |
Ohconfucius (talk | contribs) indeed, the parameter is "cs1-dates" |
||
(12 intermediate revisions by 3 users not shown) | |||
Line 1:
{{Editnotice
{{Message▼
| id = userpageedn
| header = New Features as of 26 June 2025
| headerstyle = font-size: 150%;
| text = Hello! the user script [[User:Ohconfucius/script/MOSNUM_dates.js]] has been updated to add new features in further support of [[WP:MOSNUM]] in articles. Two new functions have been added: <code>DMY_cs1=ly</code> and <code>MDY_cs1=ly</code> where dates in the body of the text (and publication dates within citation templates, plus all "loose dates" inside references) are converted to DMY or MDY; access dates and archive dates align to ymd (1978-07-14); adds template parameter {{para|cs1-dates}} with a matching value "ly".
Users are reminded to respect the [[WP:RETAIN|existing format in place]] and abide by [[WP:CONSENSUS]] when using this script.
| textstyle = font-size: 120%;
| image = File:New-Bouncywikilogo.gif
| imagesize = 90px
| style = border:DarkRed solid 2px; background:var(--background-color-neutral,white); color:var(--color-base,black);
▲}}{{Message
| bgcolor = lightblue
| border-color = royalblue
Line 14 ⟶ 25:
{{shortcut|WP:Mosnumscript|WP:MOSNUMscript}}
[[File:Update screenshot for activating MOSNUM dates.png|thumb|280px|Sidebar ___location of the script buttons
== Overview ==
Line 21 ⟶ 32:
MOSNUM allows one other format to be used in articles – but only in tables and reference sections.
<!-- '''''NOTE:''' Functions converting dates within citation templates has been withdrawn now that [[MediaWiki|MW]] software engine renders date formats automatically'' -->
There are modes that allow the user to select whether to treat body dates only or body and reference sections:
# '''
# '''
# '''DMY_cs1=ly''' – dates in the body of the text are converted to dmy ("14 July 1978" or similar); access dates and archive dates to ymd (1978-07-14); adds template parameter {{para|cs1-dates}} with a matching value "ly".
# '''MDY_cs1=ly''' – as above. prose and publication dates are aligned to mdy ("July 14, 1978" or similar); access dates and archive dates to ymd (1978-07-14); adds template parameter {{para|cs1-dates}} with a matching value "ly".
In addition, there are the following modes to convert slash or contracted dates into the desired format:
<!--
Line 33 ⟶ 44:
-->#'''US-slash dates''' – converts dates that use slash or decimal separators in formats commonly used in the US into '''mdy''' dates ''viz'': <code>mm/dd/yy</code>, <code>mm/dd/yyyy</code>, <code>mm.dd.yy</code> or <code>mm.dd.yyyy</code>
# '''UK-slash dates''' – converts dates that use slash or decimal separators in formats commonly used in the UK, Europe and elsewhere into '''dmy''' dates ''viz'': <code>dd/mm/yy</code>, <code>dd/mm/yyyy</code>, <code>dd.mm.yy</code> or <code>dd.mm.yyyy</code>
''* '''Note''': In these latter 2 cases, false positives are
== History ==
Line 46 ⟶ 57:
** delinks all dates and date fragments, including day-month strings, days, months, decades, centuries,
** converts all these date fragments to the same format, either dd mmm yyyy or mmm dd, yyyy, at the option of the user
** yyyy-mmm-dd dates within accessdate and archivedate are not acted upon, but inconsistent (out of place) dates – dd mmm yyyy or mmm dd, yyyy will be converted.
** removes ordinal suffixes and constructions such as '<span style="color:orange;">the</span> 5<span style="color:orange;">th of</span> September', 'December 25<span style="color:orange;">th</span>' or 'October <span style="color:orange;">of</span> 2003'
** adds commas where necessary (e.g. February 28, 2001)
Line 53 ⟶ 65:
* It converts other often used (but not MOSNUM-compliant) date formats within the references section, such as dd-mm-yyyy or dd-mmm-yyyy to the chosen prevailing format used in the rest of the article.
* It makes certain fixes that may be identified as [[:Category:CS1 errors: dates|CS1 dates errors]]
* cs1=ly buttons, of which there are two, insert the eponymous template parameters, and will convert underlying dates within {{para|accessdate}} and {{para|archivedate}} to ymd.
<!-- * ISO-style dates (yyyy-mm-dd) which are outside <nowiki><ref></ref></nowiki> tags are not acted upon by the script -->
The script adds or updates a non-displaying template {{tl|use mdy dates}} or {{tl|use dmy dates}} depending on the conversion used. This tagging allows for WM software engine to render date formats automatically in conformity with tagged format). It also facilitates future maintenance by bot by script [[WP:AWB|AWB]].
Line 71 ⟶ 83:
=== Optional auto-formatting citation template dates ===
Script default is without parameter
Notwithstanding the available buttons, [[Help:Citation Style 1|Citation Style 1]] and [[Help:Citation Style 2|2]] (collectively cs1|2) templates
{{#lst:Help:Citation Style 1|auto_date_format_table}}
|