Datumsprüfung bei Geburtsdatum korrigiert

This commit is contained in:
Andreas Österreicher
2021-06-14 13:13:03 +02:00
parent f52d3a455c
commit 5aacf9f9b2
2 changed files with 4 additions and 20 deletions
-17
View File
@@ -415,22 +415,5 @@ class datum
{
return intval(substr($timestring, 0, 2)) + intval(substr($timestring, 3, 2)) / 60;
}
/**
* Prueft das Datum
* @param $date = string
* @return true wenn ok, sonst false
*/
static public function verifyDate($date, $strict = true)
{
$dateTime = DateTime::createFromFormat('Y-m-d', $date);
if ($strict) {
$errors = DateTime::getLastErrors();
if (!empty($errors['warning_count'])) {
return false;
}
}
return $dateTime !== false;
}
}
?>