diff --git a/public/index.html b/public/index.html index 42c8e84..a452276 100644 --- a/public/index.html +++ b/public/index.html @@ -22,7 +22,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - + Profile Builder { - + + value && value > dayjs() + ? Promise.reject( + new Error( + "Joining date cannot be current in the future", + ), + ) + : Promise.resolve(), + }, + ]} + > diff --git a/src/components/Resume/index.js b/src/components/Resume/index.js index 4b11e0a..880a6c5 100644 --- a/src/components/Resume/index.js +++ b/src/components/Resume/index.js @@ -457,18 +457,29 @@ const Resume = forwardRef(({ data }, ref) => {
{(profile?.years_of_experience || - profile?.josh_joining_date?.String) && ( -
- {" "} - - {calculateTotalExperience( - profile?.years_of_experience, - profile?.josh_joining_date?.String, - )}{" "} - Years of Experience - -
- )} + profile?.josh_joining_date?.String) && + (() => { + const years = calculateTotalExperience( + profile?.years_of_experience, + profile?.josh_joining_date?.String, + ); + + if (years === 0) { + return null; + } + + return ( +
+ {" "} + + {years < 1 + ? `${Math.floor(years * 12)} Months of Experience` + : `${years} Year${years > 1 ? "s" : ""} of Experience`}{" "} + +
+ ); + })()} + {profile?.email && contactDetails && (
{profile?.email}