Skip to content

Commit 53e1013

Browse files
committed
fix for broken datetime writing to FileMaker with only dates - added additional checks for when formatting dates when writing FileMaker
1 parent c7d6f25 commit 53e1013

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Database/Eloquent/FMModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ public function setAttribute($key, $value)
486486
$value = $this->attributes[$key];
487487

488488
// When writing dates the regular datetime format won't work, so we have to get JUST the date value
489-
if ($this->isDateAttribute($key)) {
489+
if ($this->isDateAttribute($key) && ($this->hasCast($key, ['date'] || $this->hasCast($key, ['custom_date']) || $this->hasCast($key, ['immutable_date'])))) {
490490
$value = Arr::first(explode(' ', $value));
491491
}
492492

0 commit comments

Comments
 (0)