fix parse condition

This commit is contained in:
harshjagad20
2021-12-18 12:43:20 +05:30
parent f5c4f66165
commit 9652e3bdf5
6 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ class CustomFieldValue extends Model
public function setDateAnswerAttribute($value)
{
if ($value && $value != null) {
$this->attributes['date_answer'] = Carbon::createFromFormat('Y-m-d', $value);
$this->attributes['date_answer'] = Carbon::parse($value)->format('Y-m-d');
}
}