From 903c6fba79d86a67bab6a15118abc5b339d4df05 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 28 May 2024 23:36:37 -0500 Subject: [PATCH] Update ShowPlanes.php --- app/Http/Livewire/ShowPlanes.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index e487404..52f5645 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -313,14 +313,12 @@ class ShowPlanes extends Component } public function noRenovar() { - // Corrección 1: Calcula la diferencia de días directamente if (is_string($this->fecha_inicial_renovar)) { - $this->fecha_inicial_renovar = \Carbon\Carbon::createFromFormat('Y-m-d', $this->fecha_inicial_renovar); + $this->fecha_inicial_renovar = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $this->fecha_inicial_renovar); } if (is_string($this->fecha_final_renovar)) { - $this->fecha_final_renovar = \Carbon\Carbon::createFromFormat('Y-m-d', $this->fecha_final_renovar); + $this->fecha_final_renovar = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $this->fecha_final_renovar); } - // Ahora puedes calcular la diferencia en días $this->tiempo_usuario = $this->fecha_final_renovar->diffInDays($this->fecha_inicial_renovar);