Skip to content

A live bird collage card for your Home Assistant dashboard.

show selected timezone

ehpersonal38fd65ef6e6cc2
diff --git a/scripts/config.php b/scripts/config.php
index 0747362e..0ed20365 100644
--- a/scripts/config.php
+++ b/scripts/config.php
@@ -284,11 +284,16 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}
Select a timezone
</option>
<?php
+ $current_timezone = trim(shell_exec("cat /etc/timezone"));
$timezone_identifiers = DateTimeZone::listIdentifiers(DateTimeZone::ALL);
$n = 425;
for($i = 0; $i < $n; $i++) {
- echo "<option value='".$timezone_identifiers[$i]."'>".$timezone_identifiers[$i]."</option>";
+ $isSelected = "";
+ if($timezone_identifiers[$i] == $current_timezone) {
+ $isSelected = 'selected="selected"';
+ }
+ echo "<option $isSelected value='".$timezone_identifiers[$i]."'>".$timezone_identifiers[$i]."</option>";
}
?>
</select>