Skip to content

Commit e37c8ce

Browse files
committed
Fix Danish CPR number #125
1 parent 8a5ba75 commit e37c8ce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

api/1.3/data/DK/inject.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ module.exports = (inc, contents) => {
66

77
include(inc, contents, 'phone', random(3, 8));
88
include(inc, contents, 'cell', random(3, 8));
9+
10+
let dobDate = new Date(contents.dob.date.slice(0, -1));
911
include(inc, contents, 'id', {
1012
name: 'CPR',
11-
value: random(3, 6) + '-' + random(3, 4)
13+
value: `${pad(dobDate.getDate(), 2)}${pad(dobDate.getMonth() + 1, 2)}${dobDate.getYear()}-${random(3, 4)}`
1214
});
1315
include(inc, contents, 'picture', pic);
1416
};

0 commit comments

Comments
 (0)