Merge "(bug 42097) $.tablesorter fix when wgDefaultDateFormat is unrecognized"
authorAnomie <bjorsch@wikimedia.org>
Wed, 14 Nov 2012 20:59:03 +0000 (20:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Nov 2012 20:59:03 +0000 (20:59 +0000)
resources/jquery/jquery.tablesorter.js

index 9e2788e..71bfcab 100644 (file)
                                        s = [ match[3], match[1], match[2] ];
                                } else if ( mw.config.get( 'wgDefaultDateFormat' ) === 'dmy' ) {
                                        s = [ match[3], match[2], match[1] ];
+                               } else {
+                                       // If we get here, we don't know which order the dd-dd-dddd
+                                       // date is in. So return something not entirely invalid.
+                                       return '99999999';
                                }
                        } else if ( ( match = s.match( ts.dateRegex[1] ) ) !== null ) {
                                s = [ match[3], '' + ts.monthNames[match[2]], match[1] ];