diff --git a/app/Architecture/Providers/AppServiceProvider.php b/app/Architecture/Providers/AppServiceProvider.php index 23059cb..ce611b9 100644 --- a/app/Architecture/Providers/AppServiceProvider.php +++ b/app/Architecture/Providers/AppServiceProvider.php @@ -11,7 +11,6 @@ class AppServiceProvider extends ServiceProvider { public function boot(): void { - Carbon::macro("toDisplayString", fn() => $this->translatedFormat("j F Y")); - Carbon::macro("toDisplayDate", fn() => $this->translatedFormat("d.m.Y")); + Carbon::macro("toDisplayString", fn() => $this->translatedFormat("d.m.Y")); } } diff --git a/app/Domain/Notifications/VacationRequestApprovedNotification.php b/app/Domain/Notifications/VacationRequestApprovedNotification.php index 1243623..b21b98c 100644 --- a/app/Domain/Notifications/VacationRequestApprovedNotification.php +++ b/app/Domain/Notifications/VacationRequestApprovedNotification.php @@ -45,8 +45,8 @@ class VacationRequestApprovedNotification extends Notification $user = $this->user->first_name; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); $requester = $this->vacationRequest->user->fullName; diff --git a/app/Domain/Notifications/VacationRequestCancelledNotification.php b/app/Domain/Notifications/VacationRequestCancelledNotification.php index 48f2c36..bb5d8f4 100644 --- a/app/Domain/Notifications/VacationRequestCancelledNotification.php +++ b/app/Domain/Notifications/VacationRequestCancelledNotification.php @@ -45,8 +45,8 @@ class VacationRequestCancelledNotification extends Notification $user = $this->user->first_name; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); $requester = $this->vacationRequest->user->fullName; diff --git a/app/Domain/Notifications/VacationRequestCreatedNotification.php b/app/Domain/Notifications/VacationRequestCreatedNotification.php index 1a7777d..512191a 100644 --- a/app/Domain/Notifications/VacationRequestCreatedNotification.php +++ b/app/Domain/Notifications/VacationRequestCreatedNotification.php @@ -42,8 +42,8 @@ class VacationRequestCreatedNotification extends Notification $user = $this->vacationRequest->user->first_name; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); $appName = config("app.name"); diff --git a/app/Domain/Notifications/VacationRequestCreatedOnEmployeeBehalf.php b/app/Domain/Notifications/VacationRequestCreatedOnEmployeeBehalf.php index a5d5e14..4d2872a 100644 --- a/app/Domain/Notifications/VacationRequestCreatedOnEmployeeBehalf.php +++ b/app/Domain/Notifications/VacationRequestCreatedOnEmployeeBehalf.php @@ -43,8 +43,8 @@ class VacationRequestCreatedOnEmployeeBehalf extends Notification $user = $this->vacationRequest->user->first_name; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); $appName = config("app.name"); diff --git a/app/Domain/Notifications/VacationRequestRejectedNotification.php b/app/Domain/Notifications/VacationRequestRejectedNotification.php index 78cde0b..e538cf9 100644 --- a/app/Domain/Notifications/VacationRequestRejectedNotification.php +++ b/app/Domain/Notifications/VacationRequestRejectedNotification.php @@ -45,8 +45,8 @@ class VacationRequestRejectedNotification extends Notification $user = $this->user->first_name; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); $requester = $this->vacationRequest->user->fullName; diff --git a/app/Domain/Notifications/VacationRequestWaitsForAdminApprovalNotification.php b/app/Domain/Notifications/VacationRequestWaitsForAdminApprovalNotification.php index f870d4b..4487cde 100644 --- a/app/Domain/Notifications/VacationRequestWaitsForAdminApprovalNotification.php +++ b/app/Domain/Notifications/VacationRequestWaitsForAdminApprovalNotification.php @@ -46,8 +46,8 @@ class VacationRequestWaitsForAdminApprovalNotification extends Notification $requester = $this->vacationRequest->user->fullName; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); return (new MailMessage()) diff --git a/app/Domain/Notifications/VacationRequestWaitsForTechApprovalNotification.php b/app/Domain/Notifications/VacationRequestWaitsForTechApprovalNotification.php index 23e9866..f98cb85 100644 --- a/app/Domain/Notifications/VacationRequestWaitsForTechApprovalNotification.php +++ b/app/Domain/Notifications/VacationRequestWaitsForTechApprovalNotification.php @@ -46,8 +46,8 @@ class VacationRequestWaitsForTechApprovalNotification extends Notification $requester = $this->vacationRequest->user->fullName; $title = $this->vacationRequest->name; $type = $this->vacationRequest->type->label(); - $from = $this->vacationRequest->from->toDisplayDate(); - $to = $this->vacationRequest->to->toDisplayDate(); + $from = $this->vacationRequest->from->toDisplayString(); + $to = $this->vacationRequest->to->toDisplayString(); $days = $this->vacationRequest->vacations()->count(); return (new MailMessage()) diff --git a/app/Infrastructure/Http/Resources/VacationRequestActivityResource.php b/app/Infrastructure/Http/Resources/VacationRequestActivityResource.php index 976050e..794f218 100644 --- a/app/Infrastructure/Http/Resources/VacationRequestActivityResource.php +++ b/app/Infrastructure/Http/Resources/VacationRequestActivityResource.php @@ -13,7 +13,7 @@ class VacationRequestActivityResource extends JsonResource public function toArray($request): array { return [ - "date" => $this->created_at->toDisplayDate(), + "date" => $this->created_at->toDisplayString(), "time" => $this->created_at->format("H:i"), "user" => $this->user ? $this->user->fullName : __("System"), "state" => $this->to, diff --git a/app/Infrastructure/Http/Resources/VacationRequestResource.php b/app/Infrastructure/Http/Resources/VacationRequestResource.php index e5caa51..112d7a0 100644 --- a/app/Infrastructure/Http/Resources/VacationRequestResource.php +++ b/app/Infrastructure/Http/Resources/VacationRequestResource.php @@ -18,8 +18,8 @@ class VacationRequestResource extends JsonResource "user" => new UserResource($this->user), "type" => $this->type->label(), "state" => $this->state, - "from" => $this->from->toDisplayDate(), - "to" => $this->to->toDisplayDate(), + "from" => $this->from->toDisplayString(), + "to" => $this->to->toDisplayString(), "comment" => $this->comment, "days" => VacationResource::collection($this->vacations), ]; diff --git a/resources/js/app.js b/resources/js/app.js index 4d9a68e..14ebf63 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -38,7 +38,7 @@ Flatpickr.localize(Polish) Flatpickr.setDefaults({ dateFormat: 'Y-m-d', enableTime: false, - altFormat: 'j F Y', + altFormat: 'd.m.Y', altInput: true, })