start of week can be passed to datepicker (not used yet)

This commit is contained in:
Uwe Steinmann 2021-10-20 07:58:09 +02:00
parent ae08602e68
commit 61a53f8e90
2 changed files with 8 additions and 8 deletions

View File

@ -1404,15 +1404,15 @@ $(document).ready(function() {
echo self::getFileChooserHtml($varname, $multiple, $accept);
} /* }}} */
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='') { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate);
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null) { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate, $weekstart);
} /* }}} */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='') { /* {{{ */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null) { /* {{{ */
if(!$dateformat)
$dateformat = getConvertDateFormat();
$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).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').'>
<span class="input-append date span12 datepicker" id="'.$varName.'date" '.($weekstart == null ? '' : 'data-date-week-start="'.intval($weekstart).'" ').'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="fa fa-calendar"></i></span>
</span>';

View File

@ -1423,16 +1423,16 @@ $(document).ready(function() {
echo self::getFileChooserHtml($varname, $multiple, $accept);
} /* }}} */
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='') { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate);
function printDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null) { /* {{{ */
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate, $weekstart);
} /* }}} */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='') { /* {{{ */
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null) { /* {{{ */
if(!$dateformat)
$dateformat = getConvertDateFormat();
$content = '
<div class="input-group date" id="'.$varName.'date">
<input type="text" class="form-control datepicker" name="'.$varName.'" id="'.$varName.'" value="'.$defDate. '" 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.'"' : '').' data-date-autoclose="true" data-provide="datepicker">
<input type="text" class="form-control datepicker" name="'.$varName.'" id="'.$varName.'" value="'.$defDate. '" '.($weekstart == null ? '' : 'data-date-week-start="'.intval($weekstart).'" ').'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.'"' : '').' data-date-autoclose="true" data-provide="datepicker">
<div class="input-group-append">
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
</div>