Issue #314: Added BirthDate field to Profile builder and Castform template

This commit is contained in:
gianantoniopini
2020-11-04 13:38:43 +01:00
parent 5bf9d5ae9e
commit 59f0ff9228
6 changed files with 36 additions and 4 deletions

View File

@ -20,8 +20,11 @@ export const isFileImage = (file) => {
return file && acceptedImageTypes.includes(file.type);
};
export const formatDate = ({ date, language = 'en' }) => {
return dayjs(date).locale(language.substr(0, 2)).format('MMMM YYYY');
export const formatDate = ({ date, language = 'en', includeDay = false }) => {
const monthYearTemplate = 'MMMM YYYY';
const template = includeDay ? 'DD ' + monthYearTemplate : monthYearTemplate;
return dayjs(date).locale(language.substr(0, 2)).format(template);
};
export const formatDateRange = ({ startDate, endDate, language = 'en' }, t) => {