koblas / stdnum-js

A JavaScript library to provide functions to handle, parse and validate standard numbers.
MIT License
38 stars 26 forks source link

Swedish personummer - 12 digit output for storage and processing #117

Open a504aa1 opened 2 months ago

a504aa1 commented 2 months ago

It is recommended to store and process personnummer in 12 digit form (YYYYMMDDBBBC) to avoid ambiguity, since the 10 digit form with +/- depends on date of entry. Currently personnummer.ts accepts both forms, but can only output the 10 digit form, through format(). It would be nice to also be able to output the 12 digit form, for storage and processing.

koblas commented 2 months ago

Great points. Let me see what I can get done.