Return empty from Backend::dateTime instead of current date (#3246)

This changes Backend::dateTime to return an empty string instead of the current date when dealing with a null date. It should only affect the date field preview instance. Credit to @pvullioud
This commit is contained in:
Pierre-André Vullioud 2018-03-30 18:06:47 +02:00 committed by Luke Towers
parent c85f8297d2
commit cc082d0510
1 changed files with 4 additions and 0 deletions

View File

@ -118,6 +118,10 @@ class Backend
'timeSince' => false,
'ignoreTimezone' => false,
], $options));
if(!$dateTime) {
return '';
}
$carbon = DateTimeHelper::makeCarbon($dateTime);