Skip to content

Commit

Permalink
Fixed bug: Date & Month defaulting to current month and Date #79.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekeh committed Apr 11, 2021
1 parent 6c9a2cc commit 4c4bad6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -820,5 +820,3 @@
### Features

* none


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion projects/angular-mydatepicker/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit 4c4bad6

Please sign in to comment.