From 73966a0b614910fe6874d2547b54d1218b054fb7 Mon Sep 17 00:00:00 2001 From: SirPL Date: Tue, 5 Jul 2022 11:27:07 +0200 Subject: [PATCH] Update DataIntegrity.php --- src/DataIntegrity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataIntegrity.php b/src/DataIntegrity.php index 677de218..cfdccce6 100644 --- a/src/DataIntegrity.php +++ b/src/DataIntegrity.php @@ -228,7 +228,7 @@ public static function coerceValueToColumn( if ($column instanceof Schema\Column\Date) { if (\strlen($value) === 19) { $value = \substr($value, 0, 10); - } elseif ($value[0] === '-' || $value === '') { + } elseif ($value === '' || $value[0] === '-') { $value = '0000-00-00'; } elseif (\preg_match('/^[0-9]+$/', (string) $value)) { $value = (new \DateTime($value))->format('Y-m-d');