* Append endList for datepicker.
This commit is contained in:
@@ -185,3 +185,21 @@ window.confirmDeleteExecution = function(executionID, confirmDeleteTip)
|
||||
if(res) $.ajaxSubmit({url: $.createLink('execution', 'delete', 'executionID=' + executionID + '&comfirm=yes')});
|
||||
});
|
||||
}
|
||||
|
||||
window.getDateMenu = function()
|
||||
{
|
||||
if(!endList) return [];
|
||||
|
||||
const begin = $('input[name=begin]').val();
|
||||
if(!begin) return [];
|
||||
|
||||
let endMenu = [];
|
||||
const beginDate = new Date(begin);
|
||||
for(let key in endList)
|
||||
{
|
||||
let endDate = new Date();
|
||||
endDate.setDate(beginDate.getDate() + parseInt(key));
|
||||
endMenu.push({'text': endList[key], 'data-set-date': zui.formatDate(endDate, 'yyyy-MM-dd')});
|
||||
}
|
||||
return endMenu;
|
||||
}
|
||||
|
||||
@@ -53,8 +53,10 @@ $fields->field('dateRange')
|
||||
->control('inputGroup')
|
||||
->items(false)
|
||||
->itemBegin('begin')->control('datePicker')->id('begin')->value(empty($plan->begin) ? date('Y-m-d') : $plan->begin)->placeholder($lang->execution->begin)->itemEnd()
|
||||
->item($lang->project->to)
|
||||
->itemBegin('end')->control('datePicker')->id('end')->value(empty($plan->end) ? '' : $plan->end)->placeholder($lang->execution->end)->itemEnd();
|
||||
->item(array('control' => 'span', 'text' => '-'))
|
||||
->itemBegin('end')->control('datePicker')->id('end')->value(empty($plan->end) ? '' : $plan->end)->placeholder($lang->execution->end)
|
||||
->menu(array('items' => jsRaw('window.getDateMenu')))
|
||||
->itemEnd();
|
||||
|
||||
$fields->field('days')
|
||||
->width('1/4')
|
||||
|
||||
@@ -46,6 +46,7 @@ jsVar('weekend', $config->execution->weekend);
|
||||
jsVar('isStage', $isStage);
|
||||
jsVar('copyExecutionID', $copyExecutionID);
|
||||
jsVar('executionID', isset($executionID) ? $executionID : 0);
|
||||
jsVar('endList', $lang->execution->endList);
|
||||
|
||||
$showExecutionExec = !empty($from) and ($from == 'execution' || $from == 'doc');
|
||||
formGridPanel
|
||||
|
||||
Reference in New Issue
Block a user