Update ShowPlanes.php
This commit is contained in:
@@ -313,14 +313,12 @@ class ShowPlanes extends Component
|
|||||||
}
|
}
|
||||||
public function noRenovar()
|
public function noRenovar()
|
||||||
{
|
{
|
||||||
// Corrección 1: Calcula la diferencia de días directamente
|
|
||||||
if (is_string($this->fecha_inicial_renovar)) {
|
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)) {
|
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
|
// Ahora puedes calcular la diferencia en días
|
||||||
$this->tiempo_usuario = $this->fecha_final_renovar->diffInDays($this->fecha_inicial_renovar);
|
$this->tiempo_usuario = $this->fecha_final_renovar->diffInDays($this->fecha_inicial_renovar);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user