forked from Wavyzz/dolibarr
The standard datepicker does not display on year's date select more than 10 years ago and 10 years in the future
This commit is contained in:
@@ -6230,11 +6230,15 @@ class Form
|
||||
} elseif ($usecalendar == 'jquery') {
|
||||
if (!$disabled) {
|
||||
// Output javascript for datepicker
|
||||
$minYear = $conf->global->MIN_YEAR_SELECT_DATE ? $conf->global->MIN_YEAR_SELECT_DATE : (date('Y') - 10);
|
||||
$maxYear = $conf->global->MAX_YEAR_SELECT_DATE ? $conf->global->MAX_YEAR_SELECT_DATE : (date('Y') + 10);
|
||||
|
||||
$retstring .= "<script type='text/javascript'>";
|
||||
$retstring .= "$(function(){ $('#".$prefix."').datepicker({
|
||||
dateFormat: '".$langs->trans("FormatDateShortJQueryInput")."',
|
||||
autoclose: true,
|
||||
todayHighlight: true,";
|
||||
todayHighlight: true,
|
||||
yearRange: '".$minYear.":".$maxYear."',";
|
||||
if (!empty($conf->dol_use_jmobile)) {
|
||||
$retstring .= "
|
||||
beforeShow: function (input, datePicker) {
|
||||
|
||||
Reference in New Issue
Block a user