Skip to content

Commit bf3935a

Browse files
author
David Nahodyl
committed
fixed issue with date casting by removing fromDateTime
1 parent 2cb7ef8 commit bf3935a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/Database/Eloquent/FMModel.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,6 @@ public function getTable()
411411
return $this->layout ?? $this->table ?? Str::snake(Str::pluralStudly(class_basename($this)));
412412
}
413413

414-
/**
415-
* Convert a DateTime to a storable string.
416-
*
417-
* @param mixed $value
418-
* @return string|null
419-
*/
420-
public function fromDateTime($value)
421-
{
422-
423-
$format = $this->getDateFormat();
424-
// Check if this is just a date, and then use just the date part of the format to parse the date
425-
$exploded = explode(' ', $format);
426-
if (!str_contains($value, ' ')) {
427-
$format = $exploded[0];
428-
};
429-
430-
return empty($value) ? $value : $this->asDateTime($value)->format($format);
431-
}
432-
433414
/**
434415
* Set a given attribute on the model.
435416
*

0 commit comments

Comments
 (0)