Update timezone from Europe/London to Europe/Moscow across configuration, backend, and frontend files for consistent time handling.
This commit is contained in:
parent
457dc74485
commit
60409362c7
8 changed files with 13 additions and 13 deletions
|
|
@ -16,7 +16,7 @@ COPY backend/ ./backend/
|
|||
COPY frontend/ ./frontend/
|
||||
|
||||
# Переменные окружения
|
||||
ENV TZ=Europe/London
|
||||
ENV TZ=Europe/Moscow
|
||||
ENV PYTHONPATH=/app
|
||||
|
||||
# Запуск приложения
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ docker compose exec backend python -c "import shutil; shutil.copy2('/app/data/sc
|
|||
|
||||
## Особенности
|
||||
|
||||
- Таймзона: Europe/London
|
||||
- Таймзона: Europe/Moscow
|
||||
- Неделя начинается с понедельника
|
||||
- Дискретность времени: 15 минут (00, 15, 30, 45)
|
||||
- Диапазон времени: 08:00-20:00
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from backend.utils import (
|
|||
|
||||
router = APIRouter()
|
||||
|
||||
TZ = pytz.timezone("Europe/London")
|
||||
TZ = pytz.timezone("Europe/Moscow")
|
||||
|
||||
|
||||
@router.get("/schedule", response_model=ScheduleResponse)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from backend.models import TaskCreate, EventCreate
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
TZ = pytz.timezone("Europe/London")
|
||||
TZ = pytz.timezone("Europe/Moscow")
|
||||
BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN", "")
|
||||
|
||||
# Состояния для ConversationHandler
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import pytz
|
|||
from backend.database import Task, Event, WeeklyTaskException
|
||||
from backend.models import ScheduleItem
|
||||
|
||||
TZ = pytz.timezone("Europe/London")
|
||||
TZ = pytz.timezone("Europe/Moscow")
|
||||
|
||||
|
||||
def get_weekday_from_date(date_str: str) -> int:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ services:
|
|||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Europe/London
|
||||
- TZ=Europe/Moscow
|
||||
- DATABASE_PATH=/app/data/schedule.db
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function getTodayInLondon() {
|
|||
// Получаем текущую дату в таймзоне London
|
||||
const now = new Date();
|
||||
const formatter = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Europe/London',
|
||||
timeZone: 'Europe/Moscow',
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const TZ = 'Europe/London';
|
||||
const TZ = 'Europe/Moscow';
|
||||
|
||||
function formatDate(dateStr) {
|
||||
const date = new Date(dateStr + 'T00:00:00');
|
||||
|
|
@ -17,11 +17,11 @@ function formatDate(dateStr) {
|
|||
return `${weekday}, ${day} ${month}`;
|
||||
}
|
||||
|
||||
function getTodayInLondon() {
|
||||
// Получаем текущую дату в таймзоне London
|
||||
function getTodayInMoscow() {
|
||||
// Получаем текущую дату в таймзоне Moscow
|
||||
const now = new Date();
|
||||
const formatter = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'Europe/London',
|
||||
timeZone: 'Europe/Moscow',
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit'
|
||||
|
|
@ -30,7 +30,7 @@ function getTodayInLondon() {
|
|||
}
|
||||
|
||||
function getTomorrowInLondon() {
|
||||
const today = getTodayInLondon();
|
||||
const today = getTodayInMoscow();
|
||||
const date = new Date(today);
|
||||
date.setDate(date.getDate() + 1);
|
||||
return date.toISOString().split('T')[0];
|
||||
|
|
@ -80,7 +80,7 @@ function calculateEndTime(startTime, durationMin) {
|
|||
}
|
||||
|
||||
async function loadSchedule() {
|
||||
const today = getTodayInLondon();
|
||||
const today = getTodayInMoscow();
|
||||
const tomorrow = getTomorrowInLondon();
|
||||
|
||||
console.log('Loading schedule from', today, 'to', tomorrow);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue