Update time_condition_edit.php (#7680)

This commit is contained in:
Alex
2025-12-26 15:03:14 -07:00
committed by GitHub
parent 5d3607309b
commit 2373b45515

View File

@@ -815,14 +815,12 @@
case 'hour': //hours of day
<?php
if ($time_format == '24h') {
if ($settings->get('domain', 'time_format') == '24h') {
for ($h = 0; $h <= 23; $h++) {
echo "sel_start.options[sel_start.options.length] = new Option(".$h.", ".$h.");\n";
echo "sel_stop.options[sel_stop.options.length] = new Option(".$h.", ".$h.");\n";
}
} else {
for ($h = 0; $h <= 23; $h++) {
echo "sel_start.options[sel_start.options.length] = new Option(((".$h." != 0) ? ((".$h." >= 12) ? ((".$h." == 12) ? ".$h." : (".$h." - 12)) + ' PM' : ".$h." + ' AM') : '12 AM'), ".$h.");\n";
echo "sel_stop.options[sel_stop.options.length] = new Option(((".$h." != 0) ? ((".$h." >= 12) ? ((".$h." == 12) ? ".$h." : (".$h." - 12)) + ' PM' : ".$h." + ' AM') : '12 AM'), ".$h.");\n";
@@ -833,7 +831,7 @@
case 'time-of-day': //time of day
<?php
if ($time_format == '24h') {
if ($settings->get('domain', 'time_format') == '24h') {
for ($h = 0; $h <= 23; $h++) {
for ($m = 0; $m <= 59; $m++) {
echo "sel_start.options[sel_start.options.length] = new Option(('0'+'".$h."').slice(-2)+':'+('0'+'".$m."').slice(-2),pad('".$h."', 2) + ':' + pad(".$m.", 2));\n";