Полностью поддерживает английский язык

This commit is contained in:
AidarKC
2026-11-10 14:02:34 +03:00
parent 405b9a91a7
commit 9c30b33b39
71 changed files with 2658 additions and 1445 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
import { formatDate, formatTime } from '../i18n/format.js';
// Настройки личных чатов на этом устройстве: «без звука» (навсегда или до срока) и «закреплён».
// Сервер про них не знает: хранятся в localStorage отдельно для каждого аккаунта.
// Список «без звука» дублируется в Cache Storage, чтобы его видел service worker:
@@ -168,10 +169,10 @@ export function formatDmMuteUntil(until, now = new Date()) {
const value = Number(until || 0);
if (!value) return '';
const date = new Date(value);
const time = date.toLocaleTimeString('ru-RU', { hour: 'numeric', minute: '2-digit' });
const time = formatTime(date, { hour: 'numeric', minute: '2-digit' });
const startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
const days = Math.round((startOfDay(date) - startOfDay(now)) / 86400000);
if (days <= 0) return `до ${time}`;
if (days === 1) return `до завтра, ${time}`;
return `до ${date.toLocaleDateString('ru-RU', { day: 'numeric', month: 'long' })}, ${time}`;
return `до ${formatDate(date, { day: 'numeric', month: 'long' })}, ${time}`;
}