1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-17 18:59:21 +01:00

fix: correzione colorazione celle su campi formattabili

This commit is contained in:
Beppe 2024-11-14 18:23:45 +01:00
parent d82afe36f7
commit 0afc2875c6

View File

@ -154,6 +154,19 @@ if (!empty($query)) {
if (preg_match('/^color_(.+?)$/', $field, $m)) {
$value = isset($r['color_title_'.$m[1]]) ? $r['color_title_'.$m[1]] : '';
// Formattazione automatica
if (!empty($total['format'][$pos]) && !empty($value)) {
if (formatter()->isStandardTimestamp($value)) {
$value = Translator::timestampToLocale($value);
} elseif (formatter()->isStandardDate($value)) {
$value = Translator::dateToLocale($value);
} elseif (formatter()->isStandardTime($value)) {
$value = Translator::timeToLocale($value);
} elseif (formatter()->isStandardNumber($value)) {
$value = Translator::numberToLocale($value);
}
}
$column['class'] = 'text-center small';
$column['data-background'] = $r[$field];
}