(86400 * ($day - 1));
}));
uksort($filtered, function ($a, $b) {
if (isset($b["timestamp"]) && isset($a["timestamp"])) {
return strtotime($b["timestamp"]) - strtotime($a["timestamp"]);
} else {
return null;
}
});
return $filtered;
}
function getSwitchBefore(string $id) {
global $switches;
$currentPassed = false;
$before = null;
foreach ($switches as $switch) {
if ($currentPassed) {
$before = $switch;
break;
} else {
if ($switch["id"] === $id) {
$currentPassed = true;
}
}
}
return $before;
}
function isNotToday(int $timestamp, int $offset) {
if (date('Y-m-d', $timestamp) !== date('Y-m-d', time() - (86400 * $offset))) {
return true;
} else {
return false;
}
}
?>
= $systemID === $app["other"]["id"] ? "Front history in " . $app["other"]["name"] : $lang["history"]["title"] . " " . $systemCommonName ?>
= str_replace("%1", '-', str_replace("%2", '-', $lang["history"]["timezone"])) ?>
= frenchIfRequired($day[0]) ?>
No switches happened on that day
" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;">
= isNotToday($switch["timestamp"], $day[1]) ? "00:00" : date('H:i', $switch["timestamp"]) ?>
= $lang["history"]["fallback"] ?>