From d1c9e6e15fe94e8a0be26b0400032862e2dd7698 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 20 Sep 2020 18:04:41 +0200 Subject: [PATCH] Fix missing output value in some cases of time splitting --- src/NodaTimeSplitter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NodaTimeSplitter.php b/src/NodaTimeSplitter.php index b5e98e5..ae38835 100644 --- a/src/NodaTimeSplitter.php +++ b/src/NodaTimeSplitter.php @@ -327,10 +327,10 @@ final class NodaTimeSplitter { if (self::is_numeric((string)substr($datum, -4))) $year = substr($datum, -4); if (!empty($year) and !empty($monat) and !empty($day) and $use_day) { - return [$year, $year, $monat, $day]; + return [$year, $year, $monat, $day, '+']; } else if (!empty($year) and !empty($monat)) { - return [$year, $year, $monat, "00"]; + return [$year, $year, $monat, "00", '+']; } return []; @@ -384,10 +384,10 @@ final class NodaTimeSplitter { if (self::is_numeric((string)substr($datum, 0, 4))) $year = substr($datum, 0, 4); if (!empty($year) and !empty($monat) and !empty($day)) { - return [$year, $year, $monat, $day]; + return [$year, $year, $monat, $day, '+']; } else if (!empty($year) and !empty($monat)) { - return [$year, $year, $monat, "00"]; + return [$year, $year, $monat, "00", '+']; } return []; @@ -408,7 +408,7 @@ final class NodaTimeSplitter { return []; } - return [date("Y", $timeInt), date("m", $timeInt), date("d", $timeInt)]; + return [date("Y", $timeInt), date("m", $timeInt), date("d", $timeInt), '+']; }