1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 16:23:19 +01:00

Bugfix date FE

This commit is contained in:
Thomas Zilio 2018-09-06 15:11:45 +02:00
parent 9c970080a1
commit 30f54e3d31

View File

@ -459,23 +459,19 @@ class FatturaElettronica
} }
// Formattazione date // Formattazione date
elseif ($info['type'] == 'date') { elseif ($info['type'] == 'date') {
$object = DateTime::createFromFormat('Y-m-d H:i:s', $value); $object = \DateTime::createFromFormat('Y-m-d H:i:s', $output);
if (is_object($object)) { if (is_object($object)) {
$output = $object->format('Y-m-d'); $output = $object->format('Y-m-d');
} }
} }
// Formattazione testo // Formattazione testo
elseif ($info['type'] == 'string') { elseif ($info['type'] == 'string') {
$object = DateTime::createFromFormat('Y-m-d H:i:s', $value);
if (is_object($object)) {
$output = $object->format('Y-m-d');
}
} }
// Riduzione delle dimensioni // Riduzione delle dimensioni
if ($info['type'] != 'integer' && isset($size[1])) { if ($info['type'] != 'integer' && isset($size[1])) {
$output = trim($output); $output = trim($output);
$output = S::create($output)->substr(2, $size[1]); $output = S::create($output)->substr(2, $size[1])->__toString();
} }
// Validazione // Validazione