Fixed issue with SSN

This commit is contained in:
Erik Tiekstra
2021-09-07 14:50:56 +02:00
parent ab6cf6b7c3
commit 71180cf1be

View File

@@ -48,6 +48,7 @@ export interface EmployeesData {
}
function mapResponseToSsn(ssn: string): string {
ssn = ssn.replaceAll('-', '');
if (ssn.length === 10) {
const century = +CURRENT_YEAR - +ssn.slice(0, 2) > 0 ? '20' : '19';
ssn = ssn.padStart(12, century);