mirror of
https://github.com/smittix/intercept.git
synced 2026-07-21 07:48:11 -07:00
Add global timezone/12h-24h setting and improve satellite selection
Global time preferences (Settings > Display > Time & Timezone): - InterceptTime utility in core/utils.js with timezone + 12h/24h support - Timezone options: UTC, Local, Eastern, Central, Mountain, Pacific - Time format: 12-hour (AM/PM) or 24-hour toggle - Defaults to US/Eastern + 12-hour - Header nav clock updates to use selected timezone and format - Weather satellite mode delegates to global InterceptTime - Settings persist via localStorage, change listeners notify all modes Weather satellite improvements: - Satellite dropdown defaults to "All Meteor Satellites" showing all passes - Can still filter to specific satellite (M2-3, M2-4, M2-4-80K) - Capture button on pass cards auto-selects the correct satellite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+19
-3
@@ -77,8 +77,23 @@ function declineDisclaimer() {
|
||||
|
||||
function updateHeaderClock() {
|
||||
const now = new Date();
|
||||
const utc = now.toISOString().substring(11, 19);
|
||||
document.getElementById('headerUtcTime').textContent = utc;
|
||||
const el = document.getElementById('headerUtcTime');
|
||||
const label = document.querySelector('.utc-label');
|
||||
if (typeof InterceptTime !== 'undefined') {
|
||||
if (el) el.textContent = InterceptTime.fullTime(now);
|
||||
if (label) label.textContent = InterceptTime.getLabel() || 'LOCAL';
|
||||
} else {
|
||||
if (el) el.textContent = now.toISOString().substring(11, 19);
|
||||
}
|
||||
}
|
||||
|
||||
function initTimeSettings() {
|
||||
const tzSelect = document.getElementById('globalTimezoneSelect');
|
||||
const fmtSelect = document.getElementById('globalTimeFormatSelect');
|
||||
if (typeof InterceptTime !== 'undefined') {
|
||||
if (tzSelect) tzSelect.value = InterceptTime.getTimezone();
|
||||
if (fmtSelect) fmtSelect.value = InterceptTime.getHour12() ? '12' : '24';
|
||||
}
|
||||
}
|
||||
|
||||
// ============== MODE SWITCHING ==============
|
||||
@@ -447,7 +462,8 @@ function initApp() {
|
||||
// Load theme
|
||||
loadTheme();
|
||||
|
||||
// Start clock
|
||||
// Start clock and init time settings
|
||||
initTimeSettings();
|
||||
updateHeaderClock();
|
||||
setInterval(updateHeaderClock, 1000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user