···
echo ' ' . toTZ($dt, $_COOKIE['user-tz'], 'l \t\h\e jS \o\f F, Y \a\t ' . $hm) . PHP_EOL;
} else if ($_COOKIE['has-js'] !== '1') {
129
-
Sorry, we use JavaScript to detect your local time.<br/>
130
-
Enable it or select your time zone:<br/>
129
+
Please select your local time zone <small>(or enable JavaScript)</small>:<br/>
<select required id="user-tz" name="user-tz">
<option selected disabled>(pick one)</option>
···
149
-
<button type="submit">Submit</button><br/>
<input type="checkbox" id="user-24" name="user-24"/>
<label for="user-24"><span>24h format</span></label>
152
+
<button type="submit">Submit</button>
Did you turn off Javascript?<br/>
···
177
-
<button type="button" onclick="shareURL()">Share</button>
<input type="hidden" id="url" value="https://tz.kdy.ch<?= $_SERVER['REQUEST_URI'] ?>"/>
···
document.querySelector('.local').innerHTML = localDT + '<br/><span>(' + relative + ')</span>'
198
-
document.querySelector('.share').style.display = 'block'
198
+
const shareButton = document.createElement('button')
199
+
shareButton.type = 'button'
200
+
shareButton.textContent = 'Share'
201
+
shareButton.onclick = shareURL
202
+
document.querySelector('.share').appendChild(shareButton)
// Our share URL function
···
<form action="/" method="post">
250
+
<small>(If you only see a plain input, use the "YYYY-MM-DD HH:MM" format.)</small>
<label for="datetime">Date and Time:</label>
<input required type="datetime-local" id="datetime" name="datetime"/>