Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

Issue #314: Modified Castform template to handle data profile having no birthDate field (backward compatibility)

gianantoniopinif779ca4cbf18
diff --git a/src/templates/Castform.js b/src/templates/Castform.js
index 44d2c5585..516746d51 100644
--- a/src/templates/Castform.js
+++ b/src/templates/Castform.js
@@ -54,18 +54,22 @@ const Castform = ({ data, language }) => {
</div>
);
- const BirthDate = () => (
- data.profile.birthDate && (
- <div className="text-xs">
- <h6 className="capitalize font-semibold">
- {t('builder.profile.birthDate')}
- </h6>
- <div>
- <span>{formatDate({ date: data.profile.birthDate, language, includeDay: true })}</span>
+ const BirthDate = () => {
+ if (data.profile.birthDate) {
+ return (
+ <div className="text-xs">
+ <h6 className="capitalize font-semibold">
+ {t('builder.profile.birthDate')}
+ </h6>
+ <div>
+ <span>{formatDate({ date: data.profile.birthDate, language, includeDay: true })}</span>
+ </div>
</div>
- </div>
- )
- );
+ );
+ }
+
+ return null;
+ }
return (
<PageContext.Provider value={{ data, heading: HeadingD }}>