mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-20 19:54:08 +00:00
Fix carbon dates on custom fields value (#178)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Resources;
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
use App\Models\CompanySetting;
|
use App\Models\CompanySetting;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
class CustomFieldValueResource extends JsonResource
|
class CustomFieldValueResource extends JsonResource
|
||||||
@@ -48,11 +49,11 @@ class CustomFieldValueResource extends JsonResource
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($key == 'date_time_answer') {
|
if ($key == 'date_time_answer') {
|
||||||
return $answer->format('Y-m-d H:i');
|
return Carbon::parse($answer)->format('Y-m-d H:i');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($key == 'date_answer') {
|
if ($key == 'date_answer') {
|
||||||
return $answer->format(CompanySetting::getSetting('carbon_date_format', $this->company_id));
|
return Carbon::parse($answer)->format(CompanySetting::getSetting('carbon_date_format', $this->company_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $answer;
|
return $answer;
|
||||||
|
|||||||
Reference in New Issue
Block a user