Skip to content

Commit

Permalink
fix #84
Browse files Browse the repository at this point in the history
  • Loading branch information
lucavandro committed Jul 18, 2022
1 parent 1f1ff57 commit b5217b7
Show file tree
Hide file tree
Showing 8 changed files with 11,452 additions and 26 deletions.
2 changes: 1 addition & 1 deletion dist/codice.fiscale.amd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/codice.fiscale.commonjs2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/codice.fiscale.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/codice.fiscale.var.js

Large diffs are not rendered by default.

11,452 changes: 11,432 additions & 20 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codice-fiscale-js",
"version": "2.3.19",
"version": "2.3.20",
"description": "The Italian Tax Code Library for Javascript and Typescript",
"main": "dist/codice.fiscale.commonjs2.js",
"types": "types/codice-fiscale.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/codice-fiscale.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { extractConsonants, extractVowels, getValidDate, birthplaceFields } from

class CodiceFiscale {
get day () {
return this.birthday.getUTCDay()
return this.birthday.getUTCDate()
}
set day (d) {
this.birthday.setDate(d)
Expand Down
14 changes: 14 additions & 0 deletions tests/bug.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import CodiceFiscale from '../src/codice-fiscale.js';

describe('Error in getting day of birth in reverse CF check #85', () => {
let cf = new CodiceFiscale("RSSMRA80B01F205W")
test('genera la data di nascita corretta', () => {
expect(cf.day).toEqual(1)
expect(cf.month).toEqual(2)
expect(cf.year).toEqual(1980)
})


})


0 comments on commit b5217b7

Please sign in to comment.