diff --git a/src/components/builder/left/sections/Profile.js b/src/components/builder/left/sections/Profile.js index 45be2af4..2c4c9422 100644 --- a/src/components/builder/left/sections/Profile.js +++ b/src/components/builder/left/sections/Profile.js @@ -38,6 +38,13 @@ const Profile = ({ id }) => { path="profile.subtitle" /> + +
{ +const Castform = ({ data, language }) => { + const { t } = useTranslation(); const layout = data.metadata.layout.castform; const Photo = () => @@ -51,6 +54,19 @@ const Castform = ({ data }) => { ); + const BirthDate = () => ( + data.profile.birthDate && ( +
+
+ {t('builder.profile.birthDate')} +
+
+ {formatDate({ date: data.profile.birthDate, language, includeDay: true })} +
+
+ ) + ); + return (
{
{data.profile.heading} - +
+ + +
{layout[0] && diff --git a/src/utils/index.js b/src/utils/index.js index 87e0daa9..273c53d3 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -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) => {