jenkins-bot has submitted this change and it was merged.

Change subject: (bug 42607) $.tablesorter: require separators when detecting 
dates
......................................................................


(bug 42607) $.tablesorter: require separators when detecting dates

$.tablesorter allowed no separators in DMY- or MDY-formatted dates,
where M is a month taken from the wgMonthNames and wgMonthNamesShort
variables. This was probably intended to capture dates like
'1Dec2012'.

Unfortunately, for example the Czech language uses no short month
names, and the variable simply contains numbers from 1 to 12. This
caused the datection to break horribly and consider all numbers to be
dates.

With this patch, detection requires a space or one of the other
defined separators between month and day or year.

Change-Id: I3a37acf1985eddf922e69e2c2a1cf541fc00e97e
---
M resources/jquery/jquery.tablesorter.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  Mormegil: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/resources/jquery/jquery.tablesorter.js 
b/resources/jquery/jquery.tablesorter.js
index e08c9aa..a552237 100644
--- a/resources/jquery/jquery.tablesorter.js
+++ b/resources/jquery/jquery.tablesorter.js
@@ -424,10 +424,10 @@
                ts.dateRegex[0] = new RegExp( 
/^\s*(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{1,2})[\,\.\-\/'\s]{1,2}(\d{2,4})\s*?/i);
 
                // Written Month name, dmy
-               ts.dateRegex[1] = new RegExp( 
'^\\s*(\\d{1,2})[\\,\\.\\-\\/\'\\s]*(' + regex + ')' + 
'[\\,\\.\\-\\/\'\\s]*(\\d{2,4})\\s*$', 'i' );
+               ts.dateRegex[1] = new RegExp( 
'^\\s*(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(' + regex + ')' + 
'[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$', 'i' );
 
                // Written Month name, mdy
-               ts.dateRegex[2] = new RegExp( '^\\s*(' + regex + ')' + 
'[\\,\\.\\-\\/\'\\s]*(\\d{1,2})[\\,\\.\\-\\/\'\\s]*(\\d{2,4})\\s*$', 'i' );
+               ts.dateRegex[2] = new RegExp( '^\\s*(' + regex + ')' + 
'[\\,\\.\\-\\/\'\\s]+(\\d{1,2})[\\,\\.\\-\\/\'\\s]+(\\d{2,4})\\s*$', 'i' );
 
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/55494
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a37acf1985eddf922e69e2c2a1cf541fc00e97e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Mormegil <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to