Fix- Reactive Resume v2 Integration Empty Date

This commit is contained in:
Aadhar Chandiwala
2022-03-16 13:29:37 +05:30
parent 5a60c99df9
commit ab90a2e1dd

View File

@ -692,8 +692,8 @@ export class IntegrationsService {
summary: get(item, 'summary'), summary: get(item, 'summary'),
url: get(item, 'website'), url: get(item, 'website'),
date: { date: {
start: dayjs(get(item, 'startDate')).toISOString(), start: this.parseDate(get(item, 'startDate')),
end: dayjs(get(item, 'endDate')).toISOString(), end: this.parseDate(get(item, 'endDate')),
}, },
} as WorkExperience, } as WorkExperience,
], ],
@ -724,8 +724,8 @@ export class IntegrationsService {
summary: get(item, 'summary'), summary: get(item, 'summary'),
courses: get(item, 'courses', []), courses: get(item, 'courses', []),
date: { date: {
start: dayjs(get(item, 'startDate')).toISOString(), start: this.parseDate(get(item, 'startDate')),
end: dayjs(get(item, 'endDate')).toISOString(), end: this.parseDate(get(item, 'endDate')),
}, },
} as Education, } as Education,
], ],
@ -751,7 +751,7 @@ export class IntegrationsService {
title: get(award, 'title'), title: get(award, 'title'),
awarder: get(award, 'awarder'), awarder: get(award, 'awarder'),
summary: get(award, 'summary'), summary: get(award, 'summary'),
date: dayjs(get(award, 'date')).toISOString(), date: this.parseDate(get(award, 'date')),
} as Award, } as Award,
], ],
}, },
@ -776,7 +776,7 @@ export class IntegrationsService {
name: get(certificate, 'title'), name: get(certificate, 'title'),
issuer: get(certificate, 'issuer'), issuer: get(certificate, 'issuer'),
summary: get(certificate, 'summary'), summary: get(certificate, 'summary'),
date: dayjs(get(certificate, 'date')).toISOString(), date: this.parseDate(get(certificate, 'date')),
} as Certificate, } as Certificate,
], ],
}, },
@ -900,7 +900,7 @@ export class IntegrationsService {
keywords: get(project, 'keywords'), keywords: get(project, 'keywords'),
url: get(project, 'link'), url: get(project, 'link'),
date: { date: {
start: dayjs(get(project, 'date')).toISOString(), start: this.parseDate(get(project, 'startDate')),
}, },
} as Project, } as Project,
], ],
@ -945,4 +945,8 @@ export class IntegrationsService {
await unlink(path); await unlink(path);
} }
} }
private parseDate = (date: string): string => {
return isEmpty(date) ? '' : dayjs(date).toISOString();
};
} }