diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b4f04d..79871e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -811,7 +811,7 @@ * Peer dependencies removed from the package.json file. -# 0.11.1 (2021-04-11) +# 0.11.2 (2021-04-11) ### Bug Fixes @@ -820,5 +820,3 @@ ### Features * none - - diff --git a/package.json b/package.json index e29c853..5eae262 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-mydatepicker-example", - "version": "0.11.1", + "version": "0.11.2", "description": "Angular datepicker and date range picker", "homepage": "https://kekeh.github.io/angular-mydatepicker/", "keywords": [ diff --git a/projects/angular-mydatepicker/package.json b/projects/angular-mydatepicker/package.json index 002888c..da90ddf 100644 --- a/projects/angular-mydatepicker/package.json +++ b/projects/angular-mydatepicker/package.json @@ -1,6 +1,6 @@ { "name": "angular-mydatepicker", - "version": "0.11.1", + "version": "0.11.2", "description": "Angular datepicker and date range picker", "homepage": "https://kekeh.github.io/angular-mydatepicker/", "keywords": [ diff --git a/projects/angular-mydatepicker/src/lib/services/angular-mydatepicker.util.service.ts b/projects/angular-mydatepicker/src/lib/services/angular-mydatepicker.util.service.ts index 1713ac8..68d8463 100644 --- a/projects/angular-mydatepicker/src/lib/services/angular-mydatepicker.util.service.ts +++ b/projects/angular-mydatepicker/src/lib/services/angular-mydatepicker.util.service.ts @@ -38,7 +38,12 @@ export class UtilService { let day: number = 0; for(const dv of dateValues) { - const {format} = dv; + const {value, format} = dv; + + if (value && /^\d+$/.test(value) && Number(value) === 0) { + return returnDate; + } + if (format.indexOf(YYYY) !== -1) { year = this.getNumberByValue(dv); } @@ -50,10 +55,6 @@ export class UtilService { } } - if (year === 0 || month === 0 || day === 0) { - return returnDate; - } - const {validateDisabledDates, selectedValue} = validateOpts; year = year === 0 && selectedValue ? selectedValue.year : year;