User talk:Ohconfucius/test/MOSNUM dates.js
Bug and corrections
"{{main" becomes "{{mainmain", 13 April 2012resolved 13 April 2012"| accessdate = 25 December 2008" becomes "December 25 2008", 12 April 2012resolved 15 April 2012resolved 15 April 2012New York Times 26 Mar 1961
becomesNew York TimesMar , 26 1961
,resolved 15 April 2012<ref name="chronicle">Houston Chronicle, 18 November 2008</ref>
becomes<ref name="chronicle">Houston Chronicle,November 18 2008</ref>
http://en.wikipedia.org/w/index.php?title=Alcohol_laws_of_Utah&diff=487366373&oldid=481660290resolved 15 April 2012'05.09.08' becomes '05@ERROR@08'resolved 15 Aprildmy - Non-conversion of July 31, 2005.resolved 15 Aprildmy - Non-conversion of January 31, 2005.resolved 15 AprilUnwarranted expansion of date:resolved 20 April 2012br >Region 4: Feb 14, 2008<re
tobr />Region 4: February 14, 2008<ref
Unwarranted removal of ordinalresolved 20 April 2012resolved 20 April 2012Vol. 23, No. 5, May 1987, p. 3
becomesVol. 23, No. May 5, 1987, p. 3
"$424 billion" becomes ",24 billion"(from Virginia) resolved 13 May|date=October 10-1997}}
->date=October 10–1, 997}}
[[Progressive Conservative Association of Alberta leadership election, 2011|October 2, 2011]]
becomes[[Progressive Conservative Association of Alberta leadership election, 2011|October 02, 2011]]
- missing comma.
took place between 3–22 November 1967
becomestook place between November 3–22 1967
- stripping of hyphens without changing month "
accessed 12-08-2011
" becomes "accessed 12 08 2011
" - order of month switched with year in range
|date=2003 Jul-Aug
becomes|date=July 2003–Aug
- fails to remove ordinal 'the 17th of May'
accessdate=2012 Apr 07
becomesaccessdate=April 2012 07
- '1st Marquess' becomes '1 Marquess'
Simplifications
Hi!
What do you think about optimizing some regexes? Helder 21:46, 6 July 2012 (UTC)
Updates
Hello Ohconfucius!
Could you make these fixes and improvements to the script? Helder 02:26, 13 August 2014 (UTC)
- Done Do I have to change the function calls (from other scripts such as this) in any way? -- Ohc ¡digame! 02:32, 13 August 2014 (UTC)
- @Ohconfucius: is any function defined in this script called from another js page? Helder 03:06, 13 August 2014 (UTC)
- Helder, the only place these functions would normally be called from is my vector file, and it doesn't seem to be the case. But if I have to call it, how would this be achieved? -- Ohc ¡digame! 03:12, 13 August 2014 (UTC)
- Ohconfucius: If you are referring to any of the functions which are used in the click events, you could trigger the click event of the link associated to the function (e.g. executing
$( '#t-ISOdmy' ).click();
), and jQuery would take care of passing the event object as a parameter (which is used in the linese.preventDefault()
). But if these functions are also intended to be called without a click event, then it would need some change to avoid errors such as "ReferenceError: e is not defined". - BTW: I just noticed the script is creating duplicated ids in the page (there are 4 "t-expand", 2 "t-dmy", 2 "ca-unitfixer", etc), which is invalid in HTML. You should choose a unique id for each link. Helder 03:43, 13 August 2014 (UTC)
- Noted. I never knew what those IDs' functions were, and the fact they were the same never caused any problems. Now renamed. -- Ohc ¡digame! 03:52, 13 August 2014 (UTC)
- Ohconfucius: If you are referring to any of the functions which are used in the click events, you could trigger the click event of the link associated to the function (e.g. executing
- Helder, the only place these functions would normally be called from is my vector file, and it doesn't seem to be the case. But if I have to call it, how would this be achieved? -- Ohc ¡digame! 03:12, 13 August 2014 (UTC)