User:Ohconfucius/test/MOSNUM dates.js: Difference between revisions

Content deleted Content added
Revert to revision 1297142800 dated 2025-06-24 11:09:53 by Ohconfucius using popups
Tag: Reverted
Undid revision 1297911869 by Ohconfucius (talk)
Line 30:
script: ohc_all_to_mdy_driver
},
/*{
name: "Expand ref datesDMY_cs1=ly",
tooltip: "ExpandAccess month& namesarchive within refsdates",
script: ohc_expand_ref_dates_driverohc_dmy_cs1_ly_driver
},
{
name: "Expand all datesMDY_cs1=ly",
tooltip: "Expandsay month names throughouthello",
script: ohc_expand_all_dates_driverohc_mdy_cs1_ly_driver
},*/
{
name: "US-slash dates",
Line 236:
// Identify surprise or 'Easter egg' diversions linking months to year or "year in" articles.
.ohc_regex(/\[\[\d{1,4}#[^|\]]+\|@Month\]\]/gi, "@LMonth")
// .ohc_regex(/\[\[@yyyy \w[^|\]]{3,12}\|@Year\]\]/gi, "@Year") //disable easter egg removal per request 5 November 2022
 
// month and day piped
Line 810:
}
 
function ohc_Bigendian_ref_datesohc_refs_to_yyyymmdd(editor) {
editor
// Add a tag to the summary box
.ohc_regex(/(\|\s*(?:archive|access)-?date\s*=\s*)@Day @Month @YYYY/gi, "$1@YYYY-@MM-@DD") // conversion of dmy dates to ymd within citation templates
.replace(/(\{\{use (?:mdy|dmy) dates)(?:\|cs1-dates=\w{1,2}|)(\|[^\}\|]+\}\})/gi, "$1|cs1-dates=y$2");
.ohc_regex(/(\|\s*(?:archive|access)-?date\s*=\s*)@Month @Day, @YYYY/gi, "$1@YYYY-@MM-@DD") // conversion of mdy dates to ymd within citation templates
.replace(/(\{\{use (?:mdy|dmy) dates)(?:\|cs1-dates=\w{1,2}|)(\s*\|date=[^\}\|]+)(?=\}\})/gi, "$1$2|cs1-dates=y$2ly");
}
 
Line 1,298 ⟶ 1,300:
}
 
function ohc_dmy_publication_dates_driverohc_dmy_cs1_ly_driver(editor) {
ohc_extend_editor(editor);
 
//ohc_delink_dates(editor);
ohc_protect_dates(editor);
ohc_fix_unambiguous_dates(editor);
ohc_body_dates_to_dmy(editor);
ohc_customize_body_to_dmyohc_delink_ISO_to_dmy(editor);
ohc_dmy_publication_dates//ohc_delink_year_in_X(editor);
ohc_customize_all_to_dmy(editor);
ohc_ISO_to_dmy_in_citations(editor);
ohc_unprotect_dates(editor);
ohc_refs_to_yyyymmdd(editor);
ohc_MOSNUM_edit_summary(editor);
}
 
function ohc_mdy_cs1_ly_driver(editor) {
ohc_extend_editor(editor);
 
ohc_delink_dates(editor);
ohc_protect_dates(editor);
ohc_fix_unambiguous_dates(editor);
ohc_body_dates_to_mdy(editor);
ohc_delink_ISO_to_mdy(editor);
//ohc_delink_year_in_X(editor);
ohc_customize_all_to_mdy();
ohc_ISO_to_mdy_in_citations(editor);
ohc_unprotect_dates(editor);
ohc_refs_to_yyyymmdd(editor);
ohc_MOSNUM_edit_summary(editor);
}
 
function ohc_bigendian_driver(editor) {
ohc_refs_to_yyyymmdd(editor);
 
ohc_bigendien_edit_summary(editor);
}
 
function ohc_dmy_publication_dates_driver(editor) {
ohc_dmy_publication_dates(editor);
 
ohc_MOSNUM_edit_summary(editor);