Parser: date month - other added language data no longer removed

This commit is contained in:
Rob Garrison 2015-11-20 23:09:19 -06:00
parent 684cc1faa8
commit 8f810ef4d9
3 changed files with 19 additions and 18 deletions

View File

@ -1,2 +1,2 @@
/*! Parser: Month - updated 11/2/2015 (v2.24.1) */
!function(a){"use strict";var b=a.tablesorter;b.dates=a.extend({},{months:{en:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"}}},b.dates),b.addParser({id:"month",is:function(){return!1},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.globalize&&(h.globalize[e]||h.globalize)||{},j=b.dates.months[i.lang||"en"];h.ignoreCase&&(a=a.toLowerCase());for(g in j)if("string"==typeof g&&(f=j[g],h.ignoreCase&&(f=f.toLowerCase()),a.match(f)))return parseInt(g,10)}return a},type:"numeric"})}(jQuery);
!function(a){"use strict";var b=a.tablesorter;b.dates.months=a.extend({},{en:{1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"}},b.dates.months),b.addParser({id:"month",is:function(){return!1},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.globalize&&(h.globalize[e]||h.globalize)||{},j=b.dates.months[i.lang||"en"];h.ignoreCase&&(a=a.toLowerCase());for(g in j)if("string"==typeof g&&(f=j[g],h.ignoreCase&&(f=f.toLowerCase()),a.match(f)))return parseInt(g,10)}return a},type:"numeric"})}(jQuery);

View File

@ -189,6 +189,9 @@
bottom : false
},
// placeholder date parser data (globalize)
dates : {},
// These methods can be applied on table.config instance
instanceMethods : {},

View File

@ -5,11 +5,10 @@
'use strict';
var ts = $.tablesorter;
ts.dates = $.extend( {}, {
ts.dates.months = $.extend( {}, {
// See http://mottie.github.io/tablesorter/docs/example-widget-grouping.html
// for details on how to use CLDR data for a locale to add data for this parser
// CLDR returns an object { 1: "Jan", 2: "Feb", 3: "Mar", ..., 12: "Dec" }
months : {
'en' : {
1 : 'Jan',
2 : 'Feb',
@ -24,8 +23,7 @@
11: 'Nov',
12: 'Dec'
}
}
}, ts.dates );
}, ts.dates.months );
ts.addParser({
id: 'month',