- fix language issue when printing

This commit is contained in:
Amruth Pillai
2020-07-28 10:09:05 +05:30
parent a1d345dfb2
commit 3eb69151a6
11 changed files with 35 additions and 41 deletions

View File

@ -5,6 +5,7 @@ import 'dayjs/locale/en';
import 'dayjs/locale/es';
import 'dayjs/locale/fi';
import 'dayjs/locale/fr';
import 'dayjs/locale/ja';
import 'dayjs/locale/kn';
import 'dayjs/locale/nl';
import 'dayjs/locale/pt';

View File

@ -22,7 +22,11 @@ export const isFileImage = (file) => {
return file && acceptedImageTypes.includes(file.type);
};
export const formatDateRange = ({ startDate, endDate, language }) => {
export const formatDate = ({ date, language = 'en' }) => {
return dayjs(date).locale(language.substr(0, 2)).format('MMMM YYYY');
};
export const formatDateRange = ({ startDate, endDate, language = 'en' }) => {
const start = `${dayjs(startDate)
.locale(language.substr(0, 2))
.format('MMMM YYYY')}`;