Skip to content

Commit

Permalink
Pad numbers if smaller then 10 not 9
Browse files Browse the repository at this point in the history
  • Loading branch information
frozzare committed Mar 18, 2021
1 parent 3840f62 commit c833fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class Personnummer {
'-' +
this.month +
'-' +
(ageDay < 9 ? '0' + ageDay : ageDay);
(ageDay < 10 ? '0' + ageDay : ageDay);

return diffInYears(new Date(Date.now()), new Date(ageDate));
}
Expand Down

0 comments on commit c833fed

Please sign in to comment.