fix: [UI] Correctly update attribute timestamp

pull/8281/head
Jakub Onderka 2022-04-16 22:21:09 +02:00
parent c6d0737a90
commit bcfe08c7cf
3 changed files with 5 additions and 7 deletions

View File

@ -1975,11 +1975,7 @@ class AttributesController extends AppController
} elseif ($field === 'to_ids') {
$result = ($result == 0 ? 'No' : 'Yes');
} elseif ($field === 'timestamp') {
if (isset($result)) {
$result = date('Y-m-d', $result);
} else {
echo '&nbsp';
}
$result = date('Y-m-d', $result);
} elseif ($field === 'value') {
$this->loadModel('Warninglist');
$attribute['Attribute'] = $this->Warninglist->checkForWarning($attribute['Attribute']);

View File

@ -7,6 +7,6 @@ if ($field === 'value') {
} else if ($value === 'Yes') {
echo '<input type="checkbox" checked disabled>';
} else {
echo nl2br(h($value)) . '&nbsp;';
echo nl2br(h($value), false);
}
}

View File

@ -72,7 +72,9 @@ $quickEdit = function($fieldName) use ($editScope, $object, $event) {
<?php echo $this->element('/Events/View/seen_field', array('object' => $object)); ?>
</td>
<td class="short">
<?php echo date('Y-m-d', $object['timestamp']); ?>
<div id="Attribute_<?= $objectId ?>_timestamp_solid">
<?= date('Y-m-d', $object['timestamp']) ?>
</div>
</td>
<?php
if (!empty($extended)):