mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
fix parse condition
This commit is contained in:
@ -25,7 +25,7 @@ class CustomField extends Model
|
|||||||
public function setDateAnswerAttribute($value)
|
public function setDateAnswerAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value && $value != null) {
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class CustomFieldValue extends Model
|
|||||||
public function setDateAnswerAttribute($value)
|
public function setDateAnswerAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value && $value != null) {
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,14 +57,14 @@ class Estimate extends Model implements HasMedia
|
|||||||
public function setEstimateDateAttribute($value)
|
public function setEstimateDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['estimate_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['estimate_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setExpiryDateAttribute($value)
|
public function setExpiryDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['expiry_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['expiry_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class Expense extends Model implements HasMedia
|
|||||||
public function setExpenseDateAttribute($value)
|
public function setExpenseDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['expense_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['expense_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,14 +64,14 @@ class Invoice extends Model implements HasMedia
|
|||||||
public function setInvoiceDateAttribute($value)
|
public function setInvoiceDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['invoice_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['invoice_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDueDateAttribute($value)
|
public function setDueDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['due_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['due_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class Payment extends Model implements HasMedia
|
|||||||
public function setPaymentDateAttribute($value)
|
public function setPaymentDateAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->attributes['payment_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
$this->attributes['payment_date'] = Carbon::parse($value)->format('Y-m-d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user