From b82d192fc244e3b953eebdc7c8ed2462bed8da52 Mon Sep 17 00:00:00 2001 From: "Justin F. Hallett" Date: Mon, 10 Jun 2013 09:39:55 -0600 Subject: [PATCH] Forgot one $.datepicker call Also cleaned up a few lines for consistancy --- js/jquery.tablesorter.widgets-filter-formatter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/jquery.tablesorter.widgets-filter-formatter.js b/js/jquery.tablesorter.widgets-filter-formatter.js index de6f0e18..81582945 100644 --- a/js/jquery.tablesorter.widgets-filter-formatter.js +++ b/js/jquery.tablesorter.widgets-filter-formatter.js @@ -472,8 +472,8 @@ $.tablesorter.filterFormatter = { o.defaultDate = o.from || o.defaultDate; closeFrom = o.onClose = function( selectedDate, ui ) { - var from = (new Date($cell.find('.dateFrom').datepicker('getDate')).getTime() || ''), - to = new Date( $cell.find('.dateTo').datepicker('getDate') ).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 .find('.dateTo').datepicker('option', 'minDate', selectedDate ).end() @@ -493,8 +493,8 @@ $.tablesorter.filterFormatter = { $cell.find('.dateFrom').datepicker(o); o.defaultDate = o.to || '+7d'; // set to date +7 days from today (if not defined) o.onClose = function( selectedDate, ui ) { - var from = new Date( $cell.find('.dateFrom').val() ).getTime() || '', - to = new Date( selectedDate + ' 23:59:59' ).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 .find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()