- add "Present" key string in i18n

This commit is contained in:
Amruth Pillai
2020-08-08 08:52:30 +05:30
parent 1e5dc00da8
commit 5955567b5e
14 changed files with 27 additions and 13 deletions

View File

@ -27,13 +27,14 @@ export const formatDate = ({ date, language = 'en' }) => {
};
export const formatDateRange = ({ startDate, endDate, language = 'en' }) => {
const { t } = useTranslation();
const start = `${dayjs(startDate)
.locale(language.substr(0, 2))
.format('MMMM YYYY')}`;
const end = dayjs(endDate).isValid()
? `${dayjs(endDate).locale(language.substr(0, 2)).format('MMMM YYYY')}`
: 'Present';
: t('shared.forms.present');
return `${start} - ${end}`;
};