form : if a convertDate field provided is empty, do no generate an error

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2778 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-06-28 06:54:57 +00:00
parent ebb30781cc
commit 7ca9bb179d

View File

@@ -314,6 +314,8 @@ class form
public function convertDate ($inputDate, $inputFormat, $outputFormat)
{
$date = DateTime::CreateFromFormat ($inputFormat, $inputDate);
if ($date === false)
return $inputDate;
$errors = $date->getLastErrors();
if ($errors["warning_count"] > 0 || $errors["error_count"] > 0)
return $inputDate;