Closed fredrikmork closed 2 months ago
Hi!
When using an input without either separator (+/-) or century, the code have to guess, and we have decided to take the closest century in the parser.
So to be able to get the age/date of birth with accuracy, you would either have to use the long format (192005281528) or use a separator (200528+1528), where the separator version is the actual personnummer standard.
Hi! Ok, thanks for the quick response 🙏
Context and Results
OS is macOS Sonoma 14.5 VS Code version 1.92.0
I am expecting personnummer above 100 years to have correct century and date when invoking
Personnummer.parse(number).getDate()
andPersonnummer.parse(number).century
.I am using the swedish personnummer generator to generate a personnummer that is above 100 years. When I am parsing
Personnummer.parse('2005281528').getDate()
i get the year 2020 instead of 1920.Disclaimer: I dont know if these numbers are correct from "tedeh.com" when above 100 years.
Test case
Example on codeSandbox