2015-03-28 20:03:50 +00:00
|
|
|
/*! Parser: dates - updated 10/26/2014 (v2.18.0) */
|
|
|
|
/* Extract dates using popular natural language date parsers */
|
2013-03-26 21:05:21 +00:00
|
|
|
/*jshint jquery:true */
|
|
|
|
;(function($){
|
2015-05-02 20:15:56 +00:00
|
|
|
'use strict';
|
2013-03-26 21:05:21 +00:00
|
|
|
|
2015-03-28 20:03:50 +00:00
|
|
|
/*! Sugar (http://sugarjs.com/dates#comparing_dates) */
|
|
|
|
/* demo: http://jsfiddle.net/Mottie/abkNM/4163/ */
|
2013-03-26 21:05:21 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-02 20:15:56 +00:00
|
|
|
id: 'sugar',
|
2013-03-26 21:05:21 +00:00
|
|
|
is: function() {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function(s) {
|
2014-09-30 21:20:04 +00:00
|
|
|
var date = Date.create ? Date.create(s) : s ? new Date(s) : s;
|
|
|
|
return date instanceof Date && isFinite(date) ? date.getTime() : s;
|
2013-03-26 21:05:21 +00:00
|
|
|
},
|
2015-05-02 20:15:56 +00:00
|
|
|
type: 'numeric'
|
2013-03-26 21:05:21 +00:00
|
|
|
});
|
|
|
|
|
2015-03-28 20:03:50 +00:00
|
|
|
/*! Datejs (http://www.datejs.com/) */
|
|
|
|
/* demo: http://jsfiddle.net/Mottie/abkNM/4164/ */
|
2013-03-26 21:05:21 +00:00
|
|
|
$.tablesorter.addParser({
|
2015-05-02 20:15:56 +00:00
|
|
|
id: 'datejs',
|
2013-03-26 21:05:21 +00:00
|
|
|
is: function() {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
format: function(s) {
|
2014-09-30 21:20:04 +00:00
|
|
|
var date = Date.parse ? Date.parse(s) : s ? new Date(s) : s;
|
|
|
|
return date instanceof Date && isFinite(date) ? date.getTime() : s;
|
2013-03-26 21:05:21 +00:00
|
|
|
},
|
2015-05-02 20:15:56 +00:00
|
|
|
type: 'numeric'
|
2013-03-26 21:05:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
})(jQuery);
|