Commit e171b487 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Support.php: Fixes #8315.

parent b86172fb
Pipeline #1840 passed with stage
in 2 minutes and 20 seconds
......@@ -470,7 +470,7 @@ class Support {
* Returned value will be 'date only', 'datetime' oder 'time only', depending on the input value.
*
* @param string $dateTimeString
* @param string $dateFormat
* @param string $dateFormat FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
* @param string $showZero
* @param string $showTime
* @param string $showSeconds
......@@ -484,6 +484,7 @@ class Support {
$newDate = '';
$newTime = '';
$delim = '';
$flagDateAndTime = false;
$dateTimeString = trim($dateTimeString);
......@@ -517,13 +518,15 @@ class Support {
case 2:
$givenDate = $arr[0];
$givenTime = $arr[1];
$flagDateAndTime = true;
default:
}
// Date
if ($givenDate != '') {
if ($givenDate == '0')
if ($givenDate == '0') {
$givenDate = '0000-00-00';
}
$arr = self::splitDateToArray($givenDate);
......@@ -539,8 +542,9 @@ class Support {
// Time
if ($givenTime != '') {
if ($givenTime == '0')
if ($givenTime == '0') {
$givenTime = '0:0:0';
}
$arr = explode(':', $givenTime);
if (count($arr) < 3) {
......@@ -554,7 +558,7 @@ class Support {
}
}
if (strlen($dateTimeString) > 15) {
if ($flagDateAndTime) {
$delim = ' ';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment