User:Ohconfucius/script/MOSNUM dates: Difference between revisions

Content deleted Content added
indeed, the parameter is "cs1-dates"
 
(7 intermediate revisions by the same user 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 afterwhen you havein clicked on the 'ToolsEdit' trianglemode]]
 
== Overview ==
Line 25 ⟶ 36:
# '''DATES to dmy''' &ndash; dates in the body of the text as well as in the reference sections are converted to "14 July 1978" or similar.
# '''DATES to mdy''' &ndash; as above. dates are converted to "July 14, 1978" or similar.
# '''DMY_cs1=ly''' &ndash; 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-namedates}} with a matching value "ly".
# '''MDY_cs1=ly''' &ndash; 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-namedates}} with a matching value "ly".
In addition, there are the following modes to convert slash or contracted dates into the desired format:
<!--
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, addof which there are two, insert the eponymous template parameters, whileand will convert underlying dates within {{para|accessdate}} and {{para|archivedate}} while underlying dates are converted to ymd.
 
<!-- * ISO-style dates (yyyy-mm-dd) which are outside <nowiki><ref></ref></nowiki> tags are not acted upon by the script -->
Line 71 ⟶ 83:
 
=== Optional auto-formatting citation template dates ===
Script default is without parameter, inall whichdates case date isare aligned to the prevailing style, indicated – dmy or mdy.
 
Notwithstanding the available buttons, [[Help:Citation Style 1|Citation Style 1]] and [[Help:Citation Style 2|2]] (collectively cs1|2) templates automaticallycan be configured to render dates ({{para|date}}, {{para|access-date}}, {{para|archive-date}}, etc) in the style specified by this template. as Because it is allowedpermitted by [[WP:MOSDATES]], the cs1|2 templates can automatically format dates in a variety of styles. Editors may choose how cs1|2 templates render dates by the use of {{para|cs1-dates|&lt;{{var|keyword}}>}}.
{{#lst:Help:Citation Style 1|auto_date_format_table}}