Skip to content

Commit

Permalink
corrigir possiveis problemas com data falsa na OS (#2644)
Browse files Browse the repository at this point in the history
* corrigir possiveis problemas com data falsa na OS

* Sugestão de execão em vez de logar e colocar false.
  • Loading branch information
cabralwms authored Feb 2, 2025
1 parent 197435a commit 9b20e76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/helpers/date_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ function dateInterval($startDate, $finalDate)

// Criar o objeto representando a data
$obj_data = DateTime::createFromFormat('d/m/Y', $data);

if (!$obj_data) {
throw new InvalidArgumentException('Erro ao converter a data: ' . $startDate);
}

$obj_data->setTime(0, 0, 0);

// Realizar a soma de dias
Expand Down

0 comments on commit 9b20e76

Please sign in to comment.