Fix jQuery UI dateFormat conflict

Fixes issue with Dates not being parsed correctly when using a date that new Date() doesn't understand!
This commit is contained in:
Craig Michael Thompson 2013-10-30 17:24:58 +00:00 committed by Mottie
parent 8310e01197
commit 1dff5bd883

View File

@ -519,7 +519,7 @@ $.tablesorter.filterFormatter = {
var localfrom = o.defaultDate = o.from || o.defaultDate;
closeFrom = o.onClose = function( selectedDate, ui ) {
var from = new Date( selectedDate ).getTime() || '',
var from = new Date( $cell.find('.dateFrom').datepicker('getDate') ).getTime() || '',
to = new Date( $cell.find('.dateTo').datepicker('getDate') ).getTime() || '',
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
$cell
@ -542,7 +542,7 @@ $.tablesorter.filterFormatter = {
o.defaultDate = o.to || '+7d'; // set to date +7 days from today (if not defined)
closeTo = o.onClose = function( selectedDate, ui ) {
var from = new Date( $cell.find('.dateFrom').datepicker('getDate') ).getTime() || '',
to = new Date( selectedDate ).getTime() || '',
to = new Date( $cell.find('.dateTo').datepicker('getDate') ).getTime() || '',
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
$cell
.find('.dateRange').val(range)