diff --git a/htdocs/paypal/transaction.php b/htdocs/paypal/transaction.php index a2ba59e8986..d098f96fec9 100644 --- a/htdocs/paypal/transaction.php +++ b/htdocs/paypal/transaction.php @@ -138,6 +138,9 @@ if (empty($conf->global->PAYPAL_API_USER) || empty($conf->global->PAYPAL_API_PAS var dates = $( "#startDateStr, #endDateStr" ).datepicker({ defaultDate: "+1w", changeMonth: true, + showButtonPanel: true, + currentText: 'trans("Now"); ?>', + closeText: 'trans("Close2"); ?>', numberOfMonths: 3, monthNames: tradMonths, monthNamesShort: tradMonthsMin, @@ -154,6 +157,19 @@ if (empty($conf->global->PAYPAL_API_USER) || empty($conf->global->PAYPAL_API_PAS dates.not( this ).datepicker( "option", option, date ); } }); + // remember the old function + var _gotoToday = jQuery.datepicker._gotoToday; + // datepicker is directly inside the jQuery object, so override that + jQuery.datepicker._gotoToday = function(a){ + var target = jQuery(a); + var inst = this._getInst(target[0]); + // call the old function, so default behaviour is kept + _gotoToday.call(this, a); + // now do an additional call to _selectDate which will set the date and close + // close the datepicker (if it is not inline) + jQuery.datepicker._selectDate(a, + jQuery.datepicker._formatDate(inst,inst.selectedDay, inst.selectedMonth, inst.selectedYear)); + }; $( "div.paypal_link" ).click(function() { var id_value = $(this).attr("id"); $.jnotify("trans('PleaseBePatient'); ?>", 1500);