| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
;(function($) { |
| 6 |
'use strict'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
$.tablesorter.addParser({ |
| 11 |
id: 'sugar', |
| 12 |
is: function() { |
| 13 |
return false; |
| 14 |
}, |
| 15 |
format: function(s) { |
| 16 |
|
| 17 |
var create = Date.create || Sugar.Date.create, |
| 18 |
date = create ? create(s) : s ? new Date(s) : s; |
| 19 |
return date instanceof Date && isFinite(date) ? date.getTime() : s; |
| 20 |
}, |
| 21 |
type: 'numeric' |
| 22 |
}); |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
$.tablesorter.addParser({ |
| 27 |
id: 'datejs', |
| 28 |
is: function() { |
| 29 |
return false; |
| 30 |
}, |
| 31 |
format: function(s) { |
| 32 |
var date = Date.parse ? Date.parse(s) : s ? new Date(s) : s; |
| 33 |
return date instanceof Date && isFinite(date) ? date.getTime() : s; |
| 34 |
}, |
| 35 |
type: 'numeric' |
| 36 |
}); |
| 37 |
|
| 38 |
})(jQuery); |