Skip to content

Commit

Permalink
feat: When inputing empty string as date, transform it to null
Browse files Browse the repository at this point in the history
  • Loading branch information
KminekMatej committed Sep 6, 2024
1 parent d7bacef commit b10912a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/module/core/manager/BaseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ private function sanitizeValue(Field $field, mixed &$value): void
$value = !empty($value) ? DateHelper::createLc($value) : null; //format DateTime only if its not null or empty
break;
case Field::TYPE_DATE:
$value = $value ? DateHelper::createLc($value)->format(BaseModel::DATE_ENG_FORMAT) : $value; //format DateTime only if its not null or empty
$value = $value ? DateHelper::createLc($value)->format(BaseModel::DATE_ENG_FORMAT) : null; //format DateTime only if its not null or empty
break;
case Field::TYPE_FLOAT:
if (is_numeric($value)) {
Expand Down

0 comments on commit b10912a

Please sign in to comment.