diff --git a/Framework/Functions.php b/Framework/Functions.php index 4c8df70..d60d0e4 100755 --- a/Framework/Functions.php +++ b/Framework/Functions.php @@ -166,15 +166,17 @@ function dateEng($d) function dateLang($d, $lang=null) { - if (isset($lang) && $lang=="en_US") - { - return dateEng($d); - - } - else - { - return dateFr($d); - } + $date = DateTime::createFromFormat('d/m/Y', $d); + + if (!$date) { + return "Format de date invalide"; + } + + if (isset($lang) && $lang=="en_US") { + return $date->format('m/d/Y'); // format US + } else { + return $date->format('d/m/Y'); // format FR + } } function dateheureFr($d)