From 24697d58adfda08d38131288e5edef57826b182a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 12 Jul 2019 09:25:11 +0200 Subject: [PATCH] Use DateFormField for package dates for project (add|edit) form See #2772 --- .../files/lib/acp/form/DevtoolsProjectAddForm.class.php | 5 +++-- .../files/lib/acp/form/DevtoolsProjectEditForm.class.php | 3 ++- wcfsetup/install/lang/de.xml | 2 +- wcfsetup/install/lang/en.xml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php b/wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php index 2b7f38fd43..82187b19f4 100644 --- a/wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php @@ -14,6 +14,7 @@ use wcf\system\form\builder\container\FormContainer; use wcf\system\form\builder\container\TabFormContainer; use wcf\system\form\builder\container\TabMenuFormContainer; use wcf\system\form\builder\field\BooleanFormField; +use wcf\system\form\builder\field\DateFormField; use wcf\system\form\builder\field\dependency\NonEmptyFormFieldDependency; use wcf\system\form\builder\field\dependency\ValueFormFieldDependency; use wcf\system\form\builder\field\devtools\project\DevtoolsProjectExcludedPackagesFormField; @@ -277,11 +278,11 @@ class DevtoolsProjectAddForm extends AbstractFormBuilderForm { ->required() ->maximumLength(255), - TextFormField::create('date') + DateFormField::create('date') ->label('wcf.acp.devtools.project.packageDate') ->description('wcf.acp.devtools.project.packageDate.description') ->required() - ->maximumLength(255), + ->saveValueFormat('Y-m-d'), UrlFormField::create('packageUrl') ->label('wcf.acp.devtools.project.packageUrl') diff --git a/wcfsetup/install/files/lib/acp/form/DevtoolsProjectEditForm.class.php b/wcfsetup/install/files/lib/acp/form/DevtoolsProjectEditForm.class.php index 7b8c5b0ce2..a2412a65f2 100644 --- a/wcfsetup/install/files/lib/acp/form/DevtoolsProjectEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/DevtoolsProjectEditForm.class.php @@ -5,6 +5,7 @@ use wcf\system\exception\IllegalLinkException; use wcf\system\form\builder\container\TabMenuFormContainer; use wcf\system\form\builder\container\TabTabMenuFormContainer; use wcf\system\form\builder\field\BooleanFormField; +use wcf\system\form\builder\field\DateFormField; use wcf\system\form\builder\field\devtools\project\DevtoolsProjectExcludedPackagesFormField; use wcf\system\form\builder\field\devtools\project\DevtoolsProjectInstructionsFormField; use wcf\system\form\builder\field\devtools\project\DevtoolsProjectOptionalPackagesFormField; @@ -199,7 +200,7 @@ class DevtoolsProjectEditForm extends DevtoolsProjectAddForm { $this->missingElements[] = 'packageDescription'; } - /** @var TextFormField $date */ + /** @var DateFormField $date */ $date = $this->form->getNodeById('date'); if ($packageArchive->getPackageInfo('date') !== null) { $date->value(date('Y-m-d', $packageArchive->getPackageInfo('date'))); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 8999471bec..e1b7c0b917 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -561,7 +561,7 @@ [A-z0-9-_].]]> - YYYY-MM-DD.]]> + Dev, Alpha, Beta, RC oder pl, dem eine weietre Zahl folgt. Beispiele: 1.0.0, 2.1.0 Beta 3.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index e5040b1882..3a602f4714 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -537,7 +537,7 @@ [A-z0-9-_].]]> - YYYY-MM-DD.]]> + Dev, Alpha, Beta, RC, or pl that is followed by another number. Examples: 1.0.0, 2.1.0 Beta 3.]]> -- 2.20.1