#5 modifica della funzione dateFormat per bug segnalato

This commit is contained in:
Amministratore 2023-05-26 11:27:45 +02:00
parent 0a520d514a
commit eea34b5b52

View File

@ -213,12 +213,14 @@ class Movimenti extends Model
private static function dateFormat($type,$string) private static function dateFormat($type,$string)
{ {
$string=$string->format('d/m/Y');
if($type) if($type)
{ {
$string=$string->format('Y-m-d');
list($year,$month,$day) = explode('-',$string); list($year,$month,$day) = explode('-',$string);
return $day.'/'.$month.'/'.$year; return $day.'/'.$month.'/'.$year;
} else { } else {
$string=$string->format('d/m/Y');
list($day,$month,$year) =explode('/',$string); list($day,$month,$year) =explode('/',$string);
return $year.'-'.$month.'-'.$day; return $year.'-'.$month.'-'.$day;
} }