From dfdb6ca5c894b270e471fa4bf5c0dcd88dddbf6f Mon Sep 17 00:00:00 2001 From: KleinDev <13904220+KleinDevDE@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:54:29 +0100 Subject: [PATCH] Fixed start date in wrong format --- html/upload/upload.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/upload/upload.php b/html/upload/upload.php index 53d260e..9abba79 100644 --- a/html/upload/upload.php +++ b/html/upload/upload.php @@ -88,6 +88,9 @@ $pdo = new PDO('mysql:host=localhost;dbname=usb', $user, $pass); if ($filename == "Speiseplan") { $date = DateTime::createFromFormat($format = 'Y-m-d', $_POST['start']); + if (!$date) { + $date = DateTime::createFromFormat($format = 'd.m.Y', $_POST['start']); + } $colums = array('B', 'C', 'D', 'E', 'F'); $errors = array(); $statement = $pdo->prepare("INSERT INTO mensa (Datum, Mittagessen, Vegetarisch, Nachtisch, Abend)