add start and end date to getDateChooser()

This commit is contained in:
Uwe Steinmann 2020-06-16 07:18:30 +02:00
parent dcb7a775eb
commit f16d1821cc

View File

@ -1096,13 +1096,13 @@ $(document).ready(function() {
echo self::getFileChooserHtml($varname, $multiple, $accept);
} /* }}} */
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd') { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat);
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd', $startdate='', $enddate='') { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate);
} /* }}} */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd') { /* {{{ */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='yyyy-mm-dd', $startdate='', $enddate='') { /* {{{ */
$content = '
<span class="input-append date span12 datepicker" id="'.$varName.'date" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').'>
<span class="input-append date span12 datepicker" id="'.$varName.'date" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? ' data-date-language="'.str_replace('_', '-', $lang).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').'>
<input class="span6" size="16" name="'.$varName.'" id="'.$varName.'" type="text" value="'.$defDate.'" autocomplete="off">
<span class="add-on"><i class="icon-calendar"></i></span>
</span>';