Wikipedia talk:Date formattings/script/MOSNUM dates
This is the "master" version of my MOSNUM script where all new ideas would go. These changes would go into production version only after additional testing. The workflow proposed, to allow more users to collaborate and to facilitate bug fixing, is something as follows:
- $User comes up with an idea for an improvement of the script.
- He applies his changes on User:$User/test/mosnum.js (a version of the script in his own userspace). Some testing is done to ensure there's no significant breakage.
- $User applies the changes on User:Ohconfucius/script/upstream/MOSNUM dates. Any significant changes are discussed at User talk:Ohconfucius/script/upstream/MOSNUM dates.
- Interested users (beta-testers) can import the changes from User:Ohconfucius/master/mosnum to their own userspace and test them. The results of the testing are posted to the talk page of the master script.
- Ohconfucius imports the changes from the master script to his own userspace and tests them throughout. Lots of testing may not be needed if beta testers indicate that a lot of testing has already been done and everything works well.
- Ohconfucius introduces the changes to the production version.
Some questions about changes by Ohconfucius before 12 May
This changeset contains changes to Ohconfucius' test script that I didn't understand fully. Let's have some review and then incorporate them to the main script if everything is OK :)
1
Line 741:
- regex(/\[\[(AD|BC|CE|BCE)([\s_]?)(\d{1,4})\]\]/gi, '$3$2$1');
+ regex(/\[\[(AD|BC|CE|BCE)([\s_]?)(\d{1,4})\]\]/gi, '$1$2$3');
Why don't we reorder dates into consistent format like 123 AD after unlinking? The change removes this feature. 1exec1 (talk) 21:11, 3 June 2012 (UTC)
- I suspected that there would be a greater possibility of false positives by that approach, especially when the years are not four digits, so I opted to do it straight out of the links. --Ohconfucius ¡digame! 02:44, 4 June 2012 (UTC)
- Agree. Though I think it's worth to remove this rule altogether, because it would only match false-positives. I've already removed all links that point to the year pages. 1exec1 (talk) 16:06, 4 June 2012 (UTC)
2
Line 762:
- ohc_regex(/\[\[@day[\s_](?:of[\s_])?@month\|([^\]]{1,30})\]\]/gi, "$1");
+ ohc_regex(/\[\[@day[\s_](?:st|nd|rd|th|)[\s_](?:of[\s_])?@month\|([^\]]{1,30})\]\]/gi, "$1");
Wouldn't @th? be sufficient instead of (?:st|nd|rd|th|)? 1exec1 (talk) 21:11, 3 June 2012 (UTC)
- Possibly. I'll put that in. --Ohconfucius ¡digame! 02:44, 4 June 2012 (UTC)
3
Line 762:
- ohc_regex(/\[\[@Day\]\]/gi, "@Day");
+ // ohc_regex(/\[\[@Day\]\]/gi, "@Day");
Is there's something bad with unlinking days? 1exec1 (talk) 21:11, 3 June 2012 (UTC)
- Er, not as such, but I didn't see the utility in doing lone 2-digit numbers only on the date range (ie 1-31). All numbers up to at least 2020 should be unlinked. I already have the following in the script:
regex(/\[\[([12]\d{3}|\d{1,3})\]\]/gi, '$1');
- Ok, then it's probably worth to remove it. 1exec1 (talk) 16:11, 4 June 2012 (UTC)
4
Line 875 and 881:
+ ohc_regex(/(\()@YYYY[-–]@MM[-–]@DD(\))/gi, '$1@Day @Month @YYYY$2');
...
+ ohc_regex(/(\()@YYYY[-–]@MM[-–]@DD(\))/gi, '$1@Month @Day, @YYYY$2');
What's the reason for these additions? Was it that multiple dates within the same citation weren't converted? If it is so, then this change isn't necessary, as I've added proper fix for this problem. 1exec1 (talk) 21:11, 3 June 2012 (UTC)
- Yes, palliative to correct ISO dates within simple parentheses that were not converted. It's a very specific string that is also very common, so I added that line. --Ohconfucius ¡digame! 02:49, 4 June 2012 (UTC)
...
I'll add more later. 1exec1 (talk) 21:11, 3 June 2012 (UTC)