feat(settings): add time format preference

This commit is contained in:
Rafael Foster
2026-04-30 13:48:35 -03:00
parent f1050e1fdb
commit 8c9a5c6aa2
8 changed files with 180 additions and 12 deletions
+15
View File
@@ -300,6 +300,10 @@ async function syncPreferencesOnce() {
if (dateFormat) {
localStorage.setItem('oikos-date-format', dateFormat);
}
const timeFormat = res?.data?.time_format;
if (timeFormat) {
localStorage.setItem('oikos-time-format', timeFormat);
}
if (res?.data?.app_name) {
setAppName(res.data.app_name);
updateBranding();
@@ -1332,6 +1336,17 @@ window.addEventListener('app-name-changed', () => {
updateBranding(currentPath || '/');
});
function refreshCurrentRoute() {
if (!currentPath) return;
setTimeout(() => {
if (!currentPath) return;
navigate(currentPath, false);
}, 0);
}
window.addEventListener('date-format-changed', refreshCurrentRoute);
window.addEventListener('time-format-changed', refreshCurrentRoute);
// --------------------------------------------------------
// Virtuelle Tastatur: FAB ausblenden wenn Keyboard offen
// Erkennung via visualViewport - Höhe < 75% des Fensters = Keyboard aktiv.