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

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';
import { t, th } from '../i18n/index.js';
import { showToast } from '../services/channels-ux.js';
import { createTopBar } from '../components/topbar.js';
@@ -46,13 +47,13 @@ function describeClient(userAgent) {
// «сегодня, 02:20» / «вчера, 23:10» / «24 сентября, 18:05».
function formatSessionTime(ms) {
const date = new Date(ms);
const time = date.toLocaleTimeString('ru-RU', { hour: '2-digit', minute: '2-digit' });
const time = formatTime(date, { hour: '2-digit', minute: '2-digit' });
const startOf = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
const days = Math.round((startOf(new Date()) - startOf(date)) / 86400000);
if (days === 0) return t('screens.device_view.text_028', { value1: time });
if (days === 1) return t('screens.device_view.text_029', { value1: time });
const sameYear = date.getFullYear() === new Date().getFullYear();
const day = date.toLocaleDateString('ru-RU', { day: 'numeric', month: 'long', ...(sameYear ? {} : { year: 'numeric' }) });
const day = formatDate(date, { day: 'numeric', month: 'long', ...(sameYear ? {} : { year: 'numeric' }) });
return `${day}, ${time}`;
}