initialize form elements with default values for generating prefilled link arguments

This commit is contained in:
Daniel Seifert 2021-11-10 00:47:07 +01:00
parent 2c570943f1
commit 9d4704473d
Signed by: DanielS
GPG Key ID: 6A513E13AEE66170
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class KeyFigures extends ExportBase
public function __construct()
{
/** @var Date $startDate */
$startDateValue = Registry::getRequest()->getRequestEscapedParameter(self::STARTDATE_NAME);
$startDateValue = Registry::getRequest()->getRequestEscapedParameter(self::STARTDATE_NAME) ?: '1970-01-01';
$startDate = FormFactory::date(
Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_STARTDATE', null, true),
[
@ -42,7 +42,7 @@ class KeyFigures extends ExportBase
$this->registerFormElement($startDate);
/** @var Date $endDate */
$endDateValue = Registry::getRequest()->getRequestEscapedParameter(self::ENDDATE_NAME);
$endDateValue = Registry::getRequest()->getRequestEscapedParameter(self::ENDDATE_NAME) ?: date('Y-m-d');
$endDate = FormFactory::date(
Registry::getLang()->translateString('D3_DATAWIZARDTASKS_EXPORTS_KEYFIGURES_FIELD_ENDDATE', null, true),
[