diff --git a/frontend/public/index.html b/frontend/public/index.html index a6d55c8..7afba69 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -19,7 +19,7 @@ - + diff --git a/frontend/public/static/script.js b/frontend/public/static/script.js index a99dc7d..2b67ca3 100644 --- a/frontend/public/static/script.js +++ b/frontend/public/static/script.js @@ -36,8 +36,22 @@ function getTomorrowInLondon() { return date.toISOString().split('T')[0]; } -function renderDay(container, titleEl, dateStr, items) { - titleEl.textContent = formatDate(dateStr); +function renderDay(container, titleEl, dateStr, items, isToday = false, isTomorrow = false) { + let titleText = formatDate(dateStr); + if (isToday) { + // Преобразуем "Вторник, 30 декабря" в "Сегодня вторник, 30 декабря" + const parts = titleText.split(', '); + if (parts.length === 2) { + titleText = `Сегодня ${parts[0].toLowerCase()}, ${parts[1]}`; + } + } else if (isTomorrow) { + // Преобразуем "Среда, 31 декабря" в "Завтра среда, 31 декабря" + const parts = titleText.split(', '); + if (parts.length === 2) { + titleText = `Завтра ${parts[0].toLowerCase()}, ${parts[1]}`; + } + } + titleEl.textContent = titleText; const tasks = items.filter(item => item.kind === 'task'); const events = items.filter(item => item.kind === 'event'); @@ -101,14 +115,18 @@ async function loadSchedule() { document.getElementById('today-content'), document.getElementById('today-title'), today, - todayItems + todayItems, + true, // isToday + false ); renderDay( document.getElementById('tomorrow-content'), document.getElementById('tomorrow-title'), tomorrow, - tomorrowItems + tomorrowItems, + false, + true // isTomorrow ); } catch (error) { console.error('Error loading schedule:', error);