| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
;(function($) { |
| 5 |
'use strict'; |
| 6 |
|
| 7 |
var ts = $.tablesorter; |
| 8 |
|
| 9 |
if ( !ts.dates ) { ts.dates = {}; } |
| 10 |
if ( !ts.dates.months ) { ts.dates.months = {}; } |
| 11 |
ts.dates.months.en = { |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
1 : 'Jan', |
| 16 |
2 : 'Feb', |
| 17 |
3 : 'Mar', |
| 18 |
4 : 'Apr', |
| 19 |
5 : 'May', |
| 20 |
6 : 'Jun', |
| 21 |
7 : 'Jul', |
| 22 |
8 : 'Aug', |
| 23 |
9 : 'Sep', |
| 24 |
10: 'Oct', |
| 25 |
11: 'Nov', |
| 26 |
12: 'Dec' |
| 27 |
}; |
| 28 |
|
| 29 |
ts.addParser({ |
| 30 |
id: 'month', |
| 31 |
is: function() { |
| 32 |
return false; |
| 33 |
}, |
| 34 |
format: function( str, table, cell, cellIndex ) { |
| 35 |
if ( str ) { |
| 36 |
var m, month, |
| 37 |
c = table.config, |
| 38 |
|
| 39 |
|
| 40 |
options = c.globalize && ( c.globalize[ cellIndex ] || c.globalize ) || {}, |
| 41 |
months = ts.dates.months[ options.lang || 'en' ]; |
| 42 |
if ( c.ignoreCase ) { |
| 43 |
str = str.toLowerCase(); |
| 44 |
} |
| 45 |
for ( month in months ) { |
| 46 |
if ( typeof month === 'string' ) { |
| 47 |
m = months[ month ]; |
| 48 |
if ( c.ignoreCase ) { |
| 49 |
m = m.toLowerCase(); |
| 50 |
} |
| 51 |
if ( str.match( m ) ) { |
| 52 |
return parseInt( month, 10 ); |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
} |
| 57 |
return str; |
| 58 |
}, |
| 59 |
type: 'numeric' |
| 60 |
}); |
| 61 |
|
| 62 |
})(jQuery); |