SHA256
Полностью поддерживает английский язык
This commit is contained in:
@@ -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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user