Skip to content

Commit

Permalink
update test page
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Feb 28, 2025
1 parent 87685ce commit bcefac2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions resources/views/test.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Fonction pour tester le parsing de date
function testDateParsing($dateString) {
try {
$date = Carbon::parse($dateString);
$date = Carbon::createFromFormat('Y/m/d', $dateString);
echo "Date parsée avec succès : " . $date->toDateTimeString() . "<br>";
} catch (Exception $e) {
echo "Erreur lors du parsing de la date : " . $e->getMessage() . "<br>";
Expand All @@ -31,10 +31,9 @@ function testDateParsing($dateString) {
// Exemple de chaînes de date à tester
$dateStrings = [
'2023-10-05',
'05-10-2023',
'2023-10-05 14:30:00',
'date invalide',
'2023/10/05',
'2025/02/28',
'2021/02/01',
];
foreach ($dateStrings as $dateString) {
Expand Down

0 comments on commit bcefac2

Please sign in to comment.