Skip to content

Commit 2d5a049

Browse files
[5.x] Date modifiers shouldn't return anything when value is empty (#13178)
1 parent fb3bb2a commit 2d5a049

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Modifiers/CoreModifiers.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,6 +3281,10 @@ private function getMathModifierNumber($params, $context)
32813281

32823282
private function carbon($value)
32833283
{
3284+
if (! $value) {
3285+
return optional();
3286+
}
3287+
32843288
if (! $value instanceof Carbon) {
32853289
$value = (is_numeric($value)) ? Date::createFromTimestamp($value, config('app.timezone')) : Date::parse($value);
32863290
}

0 commit comments

Comments
 (0)