From c2abfa48c3cf4103735ee2b2d2f02ce6b90778fa Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 23 Jul 2021 17:01:37 +0300 Subject: [PATCH] Calendar: Fix localization (#1310) --- src/components/common/CalendarModal.tsx | 30 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/components/common/CalendarModal.tsx b/src/components/common/CalendarModal.tsx index bcb20b7a..ac37744a 100644 --- a/src/components/common/CalendarModal.tsx +++ b/src/components/common/CalendarModal.tsx @@ -3,10 +3,7 @@ import React, { } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import { - formatMonthAndYear, formatHumanDate, formatTime, -} from '../../util/dateFormat'; -import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; +import { formatTime, formatDateToString } from '../../util/dateFormat'; import useLang, { LangFn } from '../../hooks/useLang'; import Modal from '../ui/Modal'; @@ -28,7 +25,15 @@ export type OwnProps = { onSecondButtonClick?: NoneToVoidFunction; }; -const WEEKDAY_LETTERS = ['M', 'T', 'W', 'T', 'F', 'S', 'S']; +const WEEKDAY_LETTERS = [ + 'lng_weekday1', + 'lng_weekday2', + 'lng_weekday3', + 'lng_weekday4', + 'lng_weekday5', + 'lng_weekday6', + 'lng_weekday7', +]; const CalendarModal: FC = ({ selectedAt, @@ -183,7 +188,9 @@ const CalendarModal: FC = ({

- {formatMonthAndYear(lang, selectedDate, IS_SINGLE_COLUMN_LAYOUT)} + {lang(`lng_month${selectedDate.getMonth() + 1}`)} + {' '} + {selectedDate.getFullYear()}