diff --git a/_locales/ar/translations.json b/_locales/ar/translations.json index 144a843f..19736075 100644 --- a/_locales/ar/translations.json +++ b/_locales/ar/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "نظام الساعة بالأرقام", + "Show am/pm": "عرض صباحا/مساءا", "Show seconds": "عرض الثواني", "Date format": "تنسيق التاريخ", "Day date month": "يوم التاريخ شهر", diff --git a/_locales/ca/translations.json b/_locales/ca/translations.json index c62da4c9..c1bb024e 100644 --- a/_locales/ca/translations.json +++ b/_locales/ca/translations.json @@ -114,6 +114,7 @@ "Clock background": "Fons del rellotge", "Clock border": "Vora del rellotge", "12-Hour Time": "Hora en format 12 hores", + "Show am/pm": "Mostra am/pm", "Show seconds": "Mostrar segons", "Date format": "Format de data", "Day date month": "Dia data mes", diff --git a/_locales/da/translations.json b/_locales/da/translations.json index 6e5c66e5..679ab631 100644 --- a/_locales/da/translations.json +++ b/_locales/da/translations.json @@ -114,6 +114,7 @@ "Clock background": "Urets baggrund", "Clock border": "Urets kant", "12-Hour Time": "12-timers ur", + "Show am/pm": "Vis am/pm", "Show seconds": "Vis sekunder", "Date format": "Datoformat", "Day date month": "Dag dato måned", diff --git a/_locales/de/translations.json b/_locales/de/translations.json index 6d889966..f7c7df22 100644 --- a/_locales/de/translations.json +++ b/_locales/de/translations.json @@ -114,6 +114,7 @@ "Clock background": "Hintergrund der Uhr", "Clock border": "Rand der Uhr", "12-Hour Time": "12-Stunden Uhrzeit", + "Show am/pm": "Vormittag/Nachmittag anzeigen", "Show seconds": "Sekunden anzeigen", "Date format": "Datumsformat", "Day date month": "Tag Datum Monat", diff --git a/_locales/el/translations.json b/_locales/el/translations.json index bc3b788b..bc9fda41 100644 --- a/_locales/el/translations.json +++ b/_locales/el/translations.json @@ -114,6 +114,7 @@ "Clock background": "Φόντο ρολογιού", "Clock border": "Σύνορα ρολογιού", "12-Hour Time": "12ωρη μορφή ώρας", + "Show am/pm": "Εμφάνιση π.μ./μ.μ", "Show seconds": "Δείξε δευτερόλεπτα", "Date format": "Μορφή ημερομηνίας", "Day date month": "Ημέρα ημερομηνία μήνα", diff --git a/_locales/en/translations.json b/_locales/en/translations.json index bf5b794d..b9b87431 100644 --- a/_locales/en/translations.json +++ b/_locales/en/translations.json @@ -124,6 +124,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "12-Hour Time", + "Show am/pm": "Show am/pm", "Show seconds": "Show seconds", "Date format": "Date format", "Day date month": "Day date month", diff --git a/_locales/es/translations.json b/_locales/es/translations.json index 720840df..f1e3dcc9 100644 --- a/_locales/es/translations.json +++ b/_locales/es/translations.json @@ -114,6 +114,7 @@ "Clock background": "Fondo del reloj", "Clock border": "Borde del reloj", "12-Hour Time": "Sistema horario de 12 horas", + "Show am/pm": "Mostrar am/pm", "Show seconds": "Mostrar los segundos", "Date format": "Formato de fecha", "Day date month": "Día fecha mes", diff --git a/_locales/fa/translations.json b/_locales/fa/translations.json index a2ba2ef8..26432f52 100644 --- a/_locales/fa/translations.json +++ b/_locales/fa/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "زمان ۱۲ ساعتی", + "Show am/pm": "نمایش صبح/ظهر", "Show seconds": "نمایش ثانیه‌شمار", "Date format": "فرمت تاریخ", "Day date month": "روز تاریخ ماه", diff --git a/_locales/fi/translations.json b/_locales/fi/translations.json index dc428fe0..4be27492 100644 --- a/_locales/fi/translations.json +++ b/_locales/fi/translations.json @@ -114,6 +114,7 @@ "Clock background": "Kellon tausta", "Clock border": "Kellon reuna", "12-Hour Time": "12-tunnin aika", + "Show am/pm": "Näytä am/pm", "Show seconds": "Näytä sekunnit", "Date format": "Päivämäärän muoto", "Day date month": "Päivä päivämäärä kuukausi", diff --git a/_locales/fr/translations.json b/_locales/fr/translations.json index bb7425d5..1c060c18 100644 --- a/_locales/fr/translations.json +++ b/_locales/fr/translations.json @@ -114,6 +114,7 @@ "Clock background": "Fond d'horloge", "Clock border": "Bordure de l'horloge", "12-Hour Time": "Affichage 12h", + "Show am/pm": "Afficher am/pm", "Show seconds": "Afficher les secondes", "Date format": "Format de date", "Day date month": "Jour date mois", diff --git a/_locales/hu/translations.json b/_locales/hu/translations.json index 50921826..62d40596 100644 --- a/_locales/hu/translations.json +++ b/_locales/hu/translations.json @@ -114,6 +114,7 @@ "Clock background": "Óra háttér", "Clock border": "Óra szegély", "12-Hour Time": "12 órás formátum", + "Show am/pm": "Show am/pm", "Show seconds": "Másodpercek megjelenítése", "Date format": "Dátum formátum", "Day date month": "Nap dátum hónap", diff --git a/_locales/hy/translations.json b/_locales/hy/translations.json index b9e3bf8f..754769c1 100755 --- a/_locales/hy/translations.json +++ b/_locales/hy/translations.json @@ -114,6 +114,7 @@ "Clock background": "Ժամացույցի ֆոն", "Clock border": "Ժամացույցի եզրագիծ", "12-Hour Time": "12 Ժամյա", + "Show am/pm": "Ցույց տալ am/pm", "Show seconds": "Ցույց տալ վարկյանները", "Date format": "Ամսաթվի ձեւաչափ", "Day date month": "Օր ամսաթիվ ամիս", diff --git a/_locales/id/translations.json b/_locales/id/translations.json index a780f775..ddf9c9c5 100644 --- a/_locales/id/translations.json +++ b/_locales/id/translations.json @@ -114,6 +114,7 @@ "Clock background": "Latar belakang jam", "Clock border": "Batas jam", "12-Hour Time": "Waktu 12-Jam", + "Show am/pm": "Tampilkan am/pm", "Show seconds": "Tampilkan keduanya", "Date format": "Format Tanggal", "Day date month": "Hari tanggal bulan", diff --git a/_locales/it/translations.json b/_locales/it/translations.json index bd7b2e72..129a05cc 100644 --- a/_locales/it/translations.json +++ b/_locales/it/translations.json @@ -114,6 +114,7 @@ "Clock background": "Sfondo dell'orologio", "Clock border": "Bordo dell'orologio", "12-Hour Time": "Sistema orario a 12 ore", + "Show am/pm": "Mostra am/pm", "Show seconds": "Visualizza secondi", "Date format": "Formato data", "Day date month": "Giorno data mese", diff --git a/_locales/ja/translations.json b/_locales/ja/translations.json index 4ad58716..e58763d8 100644 --- a/_locales/ja/translations.json +++ b/_locales/ja/translations.json @@ -114,6 +114,7 @@ "Clock background": "時計の背景", "Clock border": "時計の枠", "12-Hour Time": "12時制", + "Show am/pm": "午前/午後を表示", "Show seconds": "秒まで", "Date format": "日付形式", "Day date month": "曜日 日 月", diff --git a/_locales/nb/translations.json b/_locales/nb/translations.json index 3b81aaf7..75e7293b 100644 --- a/_locales/nb/translations.json +++ b/_locales/nb/translations.json @@ -114,6 +114,7 @@ "Clock background": "Klokkebakgrunn", "Clock border": "Ramme rundt klokken", "12-Hour Time": "12-timers klokke", + "Show am/pm": "Vis am/pm", "Show seconds": "Vis sekunder", "Date format": "Datoformat", "Day date month": "Dag dato måned", diff --git a/_locales/nl/translations.json b/_locales/nl/translations.json index a55d64f8..256badb9 100644 --- a/_locales/nl/translations.json +++ b/_locales/nl/translations.json @@ -114,6 +114,7 @@ "Clock background": "Klok achtergrond", "Clock border": "Klokrand", "12-Hour Time": "12 uur tijd", + "Show am/pm": "Toon am/pm", "Show seconds": "Weergave seconden", "Date format": "Datumnotatie", "Day date month": "Dag datum maand", diff --git a/_locales/pl/translations.json b/_locales/pl/translations.json index 391974a5..1de18aae 100644 --- a/_locales/pl/translations.json +++ b/_locales/pl/translations.json @@ -114,6 +114,7 @@ "Clock background": "Tło zegara", "Clock border": "Obramowanie zegara", "12-Hour Time": "Czas 12-godzinny", + "Show am/pm": "Pokaż am/pm", "Show seconds": "Wyświetl sekundy", "Date format": "Format daty", "Day date month": "Dzień data miesiąc", diff --git a/_locales/pt-BR/translations.json b/_locales/pt-BR/translations.json index 954f2d25..11479931 100644 --- a/_locales/pt-BR/translations.json +++ b/_locales/pt-BR/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "Formato de 12 horas", + "Show am/pm": "Mostrar am/pm", "Show seconds": "Mostrar segundos", "Date format": "Formato de data", "Day date month": "Dia data mês", diff --git a/_locales/pt-PT/translations.json b/_locales/pt-PT/translations.json index a50f1f33..843e42a9 100644 --- a/_locales/pt-PT/translations.json +++ b/_locales/pt-PT/translations.json @@ -114,6 +114,7 @@ "Clock background": "Fundo do relógio", "Clock border": "Contorno do relógio", "12-Hour Time": "Formato de 12 horas", + "Show am/pm": "Mostrar am/pm", "Show seconds": "Mostrar segundos", "Date format": "Formato da data", "Day date month": "Nome dia mês", diff --git a/_locales/ro/translations.json b/_locales/ro/translations.json index 67348d15..8d7674f8 100644 --- a/_locales/ro/translations.json +++ b/_locales/ro/translations.json @@ -114,6 +114,7 @@ "Clock background": "Fundal de ceas", "Clock border": "Marginea ceasului", "12-Hour Time": "Ceas de 12 ore", + "Show am/pm": "Afișare am/pm", "Show seconds": "Afișează secundele", "Date format": "Formatul datei", "Day date month": "Zi dată lună", diff --git a/_locales/ru/translations.json b/_locales/ru/translations.json index 6de5f112..4068f669 100644 --- a/_locales/ru/translations.json +++ b/_locales/ru/translations.json @@ -114,6 +114,7 @@ "Clock background": "Фон часов", "Clock border": "Часовая рамка", "12-Hour Time": "12-часовой формат времени", + "Show am/pm": "Показать до/после полудня", "Show seconds": "Показывать секунды", "Date format": "Формат даты", "Day date month": "День число месяц", diff --git a/_locales/sk/translations.json b/_locales/sk/translations.json index 06713399..375380a2 100644 --- a/_locales/sk/translations.json +++ b/_locales/sk/translations.json @@ -114,6 +114,7 @@ "Clock background": "Pozadie hodín", "Clock border": "Okraj hodín", "12-Hour Time": "12-hodinový čas", + "Show am/pm": "Zobraziť am/pm", "Show seconds": "Zobraziť sekundy", "Date format": "Formát dátumu", "Day date month": "Deň dátum mesiac", diff --git a/_locales/sr-YU/translations.json b/_locales/sr-YU/translations.json index 5dc8e25f..4b893b1a 100644 --- a/_locales/sr-YU/translations.json +++ b/_locales/sr-YU/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "12-to časovni prikaz sata.", + "Show am/pm": "Схов ам/пм", "Show seconds": "Prikaži sekunde", "Date format": "Format datuma", "Day date month": "Дан датум месец", diff --git a/_locales/sr/translations.json b/_locales/sr/translations.json index 5abb79f1..ff6aa5b1 100644 --- a/_locales/sr/translations.json +++ b/_locales/sr/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "12-то часовни приказ сата.", + "Show am/pm": "Схов ам/пм", "Show seconds": "Прикажи секунде", "Date format": "Формат датума", "Day date month": "Дан датум месец", diff --git a/_locales/sv/translations.json b/_locales/sv/translations.json index 05db8936..53b710d4 100644 --- a/_locales/sv/translations.json +++ b/_locales/sv/translations.json @@ -114,6 +114,7 @@ "Clock background": "Klocka bakgrund", "Clock border": "Klockans kant", "12-Hour Time": "12-timmars klocka", + "Show am/pm": "Visa am/pm", "Show seconds": "Visa sekunder", "Date format": "Datumformat", "Day date month": "Dag datum månad", diff --git a/_locales/tr/translations.json b/_locales/tr/translations.json index fb43b3cb..ec458377 100644 --- a/_locales/tr/translations.json +++ b/_locales/tr/translations.json @@ -114,6 +114,7 @@ "Clock background": "Saat arka planı", "Clock border": "Saat kenarlığı", "12-Hour Time": "12 Saatlik zaman", + "Show am/pm": "Sabah/öğleden sonra göster", "Show seconds": "Saniyeyi göster", "Date format": "Tarih formatı", "Day date month": "Gün tarih ay", diff --git a/_locales/uk/translations.json b/_locales/uk/translations.json index c0fa0586..1eacd692 100644 --- a/_locales/uk/translations.json +++ b/_locales/uk/translations.json @@ -114,6 +114,7 @@ "Clock background": "Фон годинника", "Clock border": "Годинникова рамка", "12-Hour Time": "12-годинний формат часу", + "Show am/pm": "Показати ранок/південь", "Show seconds": "Показувати секунди", "Date format": "Формат дати", "Day date month": "День дата місяць", diff --git a/_locales/vi/translations.json b/_locales/vi/translations.json index e60e3228..34be6789 100644 --- a/_locales/vi/translations.json +++ b/_locales/vi/translations.json @@ -114,6 +114,7 @@ "Clock background": "Clock background", "Clock border": "Clock border", "12-Hour Time": "Chỉ 12 tiếng", + "Show am/pm": "Hiển thị sáng/chiều", "Show seconds": "Hiện giây", "Date format": "Định dạng ngày tháng", "Day date month": "[Thứ] [Ngày] [Tháng]", diff --git a/_locales/zh-CN/translations.json b/_locales/zh-CN/translations.json index ea9e41e3..90ad3475 100644 --- a/_locales/zh-CN/translations.json +++ b/_locales/zh-CN/translations.json @@ -114,6 +114,7 @@ "Clock background": "时钟背景", "Clock border": "时钟边框", "12-Hour Time": "12 小时制", + "Show am/pm": "显示上午/下午", "Show seconds": "显示秒", "Date format": "日期格式", "Day date month": "星期 日期 月份", diff --git a/_locales/zh-HK/translations.json b/_locales/zh-HK/translations.json index dfe1fd73..8223023d 100644 --- a/_locales/zh-HK/translations.json +++ b/_locales/zh-HK/translations.json @@ -114,6 +114,7 @@ "Clock background": "时钟背景", "Clock border": "时钟边框", "12-Hour Time": "12 小時制", + "Show am/pm": "顯示上午/下午", "Show seconds": "顯示秒", "Date format": "日期格式", "Day date month": "星期 日期 月份", diff --git a/_locales/zh-TW/translations.json b/_locales/zh-TW/translations.json index 727d0596..eb4257a8 100644 --- a/_locales/zh-TW/translations.json +++ b/_locales/zh-TW/translations.json @@ -114,6 +114,7 @@ "Clock background": "時鐘背景", "Clock border": "時鐘邊框", "12-Hour Time": "12 小時制", + "Show am/pm": "顯示上午/下午", "Show seconds": "顯示秒", "Date format": "日期格式", "Day date month": "星期 日期 月份", diff --git a/src/scripts/defaults.ts b/src/scripts/defaults.ts index 746b8100..1542c623 100644 --- a/src/scripts/defaults.ts +++ b/src/scripts/defaults.ts @@ -117,6 +117,7 @@ export const SYNC_DEFAULT: Sync.Storage = { ampm: false, analog: false, seconds: false, + ampmlabel: false, worldclocks: false, timezone: 'auto', }, diff --git a/src/scripts/features/clock.ts b/src/scripts/features/clock.ts index 11def530..3a1bc24f 100644 --- a/src/scripts/features/clock.ts +++ b/src/scripts/features/clock.ts @@ -9,6 +9,7 @@ import storage from '../storage' type ClockUpdate = { ampm?: boolean + ampmlabel?: boolean analog?: boolean seconds?: boolean dateformat?: string @@ -128,6 +129,7 @@ async function clockUpdate(update: ClockUpdate) { analog: update.analog ?? data.clock.analog, seconds: update.seconds ?? data.clock.seconds, timezone: update.timezone ?? data.clock.timezone, + ampmlabel: update.ampmlabel ?? data.clock.ampmlabel, worldclocks: update.worldclocks ?? data.clock.worldclocks, } @@ -275,8 +277,11 @@ function digital(wrapper: HTMLElement, date: Date, clock: Sync.Clock) { return } - if (!clock.ampm) delete domclock.dataset.ampm + if (clock.ampmlabel) domclock.dataset.ampmLabel = '' + else delete domclock.dataset.ampmLabel + if (clock.ampm) domclock.dataset.ampm = date.getHours() < 13 ? 'am' : 'pm' + else delete domclock.dataset.ampm if (clock.ampm && h === 0) { h = 12 diff --git a/src/scripts/settings.ts b/src/scripts/settings.ts index 8b5830af..9f411cfa 100644 --- a/src/scripts/settings.ts +++ b/src/scripts/settings.ts @@ -165,6 +165,7 @@ function initOptionsValues(data: Sync.Storage) { setCheckbox('i_sb', data.searchbar?.on ?? false) setCheckbox('i_quotes', data.quotes?.on ?? false) setCheckbox('i_ampm', data.clock?.ampm ?? false) + setCheckbox('i_ampm-label', data.clock?.ampmlabel ?? false) setCheckbox('i_sbsuggestions', data.searchbar?.suggestions ?? true) setCheckbox('i_sbnewtab', data.searchbar?.newtab ?? false) setCheckbox('i_qtauthor', data.quotes?.author ?? false) @@ -200,6 +201,7 @@ function initOptionsValues(data: Sync.Storage) { paramId('time_options')?.classList.toggle('shown', data.time) paramId('analog_options')?.classList.toggle('shown', data.clock.analog && data.showall) paramId('digital_options')?.classList.toggle('shown', !data.clock.analog) + paramId('ampm_label')?.classList.toggle('shown', data.clock.ampm) paramId('worldclocks_options')?.classList.toggle('shown', data.clock.worldclocks) paramId('main_options')?.classList.toggle('shown', data.main) paramId('weather_provider')?.classList.toggle('shown', data.weather?.moreinfo === 'custom') @@ -464,6 +466,10 @@ function initOptionsEvents() { clock(undefined, { ampm: target.checked }) }) + paramId('i_ampm-label').onclickdown(function (_, target) { + clock(undefined, { ampmlabel: target.checked }) + }) + paramId('i_timezone').addEventListener('change', function (this: HTMLInputElement) { clock(undefined, { timezone: this.value }) }) diff --git a/src/settings.html b/src/settings.html index 72a16f0c..c02923f2 100644 --- a/src/settings.html +++ b/src/settings.html @@ -477,6 +477,15 @@

Time & Date

+ +
diff --git a/src/styles/_settings.css b/src/styles/_settings.css index 6d6ff8d7..7aa8d494 100644 --- a/src/styles/_settings.css +++ b/src/styles/_settings.css @@ -424,17 +424,18 @@ aside form.valid button { max-height: 180px; } +#ampm_label.shown, #location_options.shown, -#digital_options.shown, #weather_provider.shown, #searchbar_request.shown, #worldclocks-list .dropdown.shown { max-height: 60px; } +#digital_options.shown, #unsplash_options.shown, #quotes_url.shown { - max-height: 110px; + max-height: 120px; } #searchbar_options.shown { diff --git a/src/styles/features/time.css b/src/styles/features/time.css index 06ddceb7..4697986a 100644 --- a/src/styles/features/time.css +++ b/src/styles/features/time.css @@ -84,13 +84,13 @@ display: none; } -[data-ampm] .digital-ampm, -[data-ampm='am'] .digital-am, -[data-ampm='pm'] .digital-pm { +[data-ampm-label][data-ampm] .digital-ampm, +[data-ampm-label][data-ampm='am'] .digital-am, +[data-ampm-label][data-ampm='pm'] .digital-pm { display: inline-block; } -[data-ampm] { +[data-ampm-label][data-ampm] { margin-inline-end: 0.5em; } diff --git a/src/types/sync.ts b/src/types/sync.ts index 68bd9a14..d6c569de 100644 --- a/src/types/sync.ts +++ b/src/types/sync.ts @@ -79,6 +79,7 @@ declare namespace Sync { seconds: boolean timezone: string size: number + ampmlabel: boolean worldclocks: boolean // <20.0 face?: 'none' | 'number' | 'roman' | 'marks'