This commit is contained in:
Kseninia Mikhaylova 2024-11-19 12:16:26 +03:00
parent 9fab6b3c94
commit 06b8325cd8
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ from app.constants import *
app = FastAPI() app = FastAPI()
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory="templates")
locale.setlocale(locale.LC_TIME, 'ru_RU') try:
locale.setlocale(locale.LC_TIME, 'ru_RU')
except Exception as e:
logger.error(e)
# Создаем кастомный фильтр для форматирования дат # Создаем кастомный фильтр для форматирования дат
def format_datetime(value, format="%d %B %Y, %H:%M:%S"): def format_datetime(value, format="%d %B %Y, %H:%M:%S"):