feat(settings): 12-hour AM/PM time format for English locale in theme scheduler

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-08 15:23:46 +02:00
parent 64d8b1cbd3
commit 041d946b58
+8 -4
View File
@@ -1240,10 +1240,14 @@ export default function Settings() {
const themeOptions = THEME_GROUPS.flatMap(g => const themeOptions = THEME_GROUPS.flatMap(g =>
g.themes.map(th => ({ value: th.id, label: th.label, group: g.group })) g.themes.map(th => ({ value: th.id, label: th.label, group: g.group }))
); );
const hourOptions = Array.from({ length: 24 }, (_, i) => ({ const use12h = i18n.language === 'en';
value: String(i).padStart(2, '0'), const hourOptions = Array.from({ length: 24 }, (_, i) => {
label: String(i).padStart(2, '0'), const value = String(i).padStart(2, '0');
})); const label = use12h
? `${i % 12 === 0 ? 12 : i % 12} ${i < 12 ? 'AM' : 'PM'}`
: value;
return { value, label };
});
const minuteOptions = ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'].map(m => ({ value: m, label: m })); const minuteOptions = ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'].map(m => ({ value: m, label: m }));
const dayH = theme.timeDayStart.split(':')[0]; const dayH = theme.timeDayStart.split(':')[0];
const dayM = theme.timeDayStart.split(':')[1]; const dayM = theme.timeDayStart.split(':')[1];