diff --git a/package-lock.json b/package-lock.json index c0562b2..57b862d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ngx-mat-birthday-input", - "version": "17.2.0", + "version": "17.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ngx-mat-birthday-input", - "version": "17.2.0", + "version": "17.2.1", "dependencies": { "@angular/animations": "^17.3.0", "@angular/cdk": "^17.3.0", @@ -27,7 +27,7 @@ "@angular-devkit/build-angular": "^17.3.0", "@angular/cli": "^17.3.0", "@angular/compiler-cli": "^17.3.0", - "@commitlint/cli": "^19.2.0", + "@commitlint/cli": "^19.2.1", "@commitlint/config-conventional": "^19.1.0", "@semantic-release/apm-config": "9.0.1", "@types/jasmine": "~5.1.4", @@ -2329,15 +2329,15 @@ } }, "node_modules/@commitlint/cli": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.2.0.tgz", - "integrity": "sha512-8XnQDMyQR+1/ldbmIyhonvnDS2enEw48Wompo/967fsEvy9Vj5/JbDutzmSBKxANWDVeEbR9QQm0yHpw6ArrFw==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.2.1.tgz", + "integrity": "sha512-cbkYUJsLqRomccNxvoJTyv5yn0bSy05BBizVyIcLACkRbVUqYorC351Diw/XFSWC/GtpwiwT2eOvQgFZa374bg==", "dev": true, "dependencies": { "@commitlint/format": "^19.0.3", "@commitlint/lint": "^19.1.0", "@commitlint/load": "^19.2.0", - "@commitlint/read": "^19.2.0", + "@commitlint/read": "^19.2.1", "@commitlint/types": "^19.0.3", "execa": "^8.0.1", "yargs": "^17.0.0" @@ -2511,9 +2511,9 @@ } }, "node_modules/@commitlint/read": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.2.0.tgz", - "integrity": "sha512-HlGeEd/jyp2a5Fb9mvtsaDm5hFCmj80dJYjLQkpG3DzWneWBc37YU3kM8Za1D1HUazZaTkdsWq73M3XDE4CvCA==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.2.1.tgz", + "integrity": "sha512-qETc4+PL0EUv7Q36lJbPG+NJiBOGg7SSC7B5BsPWOmei+Dyif80ErfWQ0qXoW9oCh7GTpTNRoaVhiI8RbhuaNw==", "dev": true, "dependencies": { "@commitlint/top-level": "^19.0.0", diff --git a/package.json b/package.json index a93df6e..a8a6f2d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-mat-birthday-input", - "version": "17.2.0", + "version": "17.2.1", "scripts": { "ng": "ng", "start": "ng serve", @@ -32,7 +32,7 @@ "@angular-devkit/build-angular": "^17.3.0", "@angular/cli": "^17.3.0", "@angular/compiler-cli": "^17.3.0", - "@commitlint/cli": "^19.2.0", + "@commitlint/cli": "^19.2.1", "@commitlint/config-conventional": "^19.1.0", "@semantic-release/apm-config": "9.0.1", "@types/jasmine": "~5.1.4", diff --git a/projects/ngx-mat-birthday-input/package.json b/projects/ngx-mat-birthday-input/package.json index 6456331..33c895b 100644 --- a/projects/ngx-mat-birthday-input/package.json +++ b/projects/ngx-mat-birthday-input/package.json @@ -1,6 +1,6 @@ { "name": "ngx-mat-birthday-input", - "version": "17.2.0", + "version": "17.2.1", "author": { "name": "Raphaƫl Balet", "email": "raphael.balet@outlook.com" diff --git a/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts b/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts index 760a209..7962fe7 100644 --- a/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts +++ b/projects/ngx-mat-birthday-input/src/lib/ngx-mat-birthday-input.component.ts @@ -165,11 +165,11 @@ export class NgxMatBirthdayInputComponent .get('day') ?.valueChanges.pipe(takeUntil(this._unsubscribe$)) .subscribe((value) => { - if (!this._controlValue(value, 'day')) return if (value.includes('00')) { this._controls.day?.setValue(this._formerValues.day) return } + if (!this._controlValue(value, 'day')) return if (+value > 31) this._controls.day?.setValue('31') else if (typeof value === 'number' && value < 0) this._controls.day?.setValue('01') @@ -186,11 +186,11 @@ export class NgxMatBirthdayInputComponent .get('month') ?.valueChanges.pipe(takeUntil(this._unsubscribe$)) .subscribe((value) => { - if (!this._controlValue(value, 'month')) return if (value.includes('00')) { this._controls.month?.setValue(this._formerValues.month) return } + if (!this._controlValue(value, 'month')) return if (+value > 12) this._controls.month?.setValue('12') else if (typeof value === 'number' && value < 0) this._controls.month?.setValue('01')