solving bugs reported in GH issues

This commit is contained in:
Amruth Pillai
2020-07-24 21:54:48 +05:30
parent 586f2b1eca
commit f2a0b612d0
21 changed files with 827 additions and 979 deletions

View File

@ -22,15 +22,13 @@ export const isFileImage = (file) => {
return file && acceptedImageTypes.includes(file.type);
};
export const formatDateRange = ({ startDate, endDate }) => {
const { i18n } = useTranslation();
export const formatDateRange = ({ startDate, endDate, language }) => {
const start = `${dayjs(startDate)
.locale(i18n.language.substr(0, 2))
.locale(language.substr(0, 2))
.format('MMMM YYYY')}`;
const end = dayjs(endDate).isValid()
? `${dayjs(endDate).locale(i18n.language.substr(0, 2)).format('MMMM YYYY')}`
? `${dayjs(endDate).locale(language.substr(0, 2)).format('MMMM YYYY')}`
: 'Present';
return `${start} - ${end}`;