Skip to content

Commit

Permalink
Spin Button Date Picker Example: Fix incrementing and decrementing pa…
Browse files Browse the repository at this point in the history
…st limits (pull #1154)

Fixes the following bugs in the date picker spin button example:
1. The day would show NaN when decrementing past the min value or incrementing past the max value.
2. The year would show NaN when setting to min or max with home or end keys.
3. The year could be set beyond the min or max year by incrementing or decrementing.
  • Loading branch information
backwardok authored and mcking65 committed Sep 28, 2019
1 parent e451c93 commit 559f473
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/spinbutton/js/spinbutton-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ var SpinButtonDate = function (domNode, values, callback) {
}
}
else {
this.valueMin = parseInt(domNode.getAttribute('aria-valuemin'));
this.valueMax = parseInt(domNode.getAttribute('aria-valuemax'));
this.valueNow = parseInt(domNode.getAttribute('aria-valuenow'));
this.valueText = domNode.getAttribute('aria-valuenow');
this.valueMin = parseInt(this.spinbuttonNode.getAttribute('aria-valuemin'));
this.valueMax = parseInt(this.spinbuttonNode.getAttribute('aria-valuemax'));
this.valueNow = parseInt(this.spinbuttonNode.getAttribute('aria-valuenow'));
this.valueText = this.spinbuttonNode.getAttribute('aria-valuenow');
}

this.keyCode = Object.freeze({
Expand Down

0 comments on commit 559f473

Please sign in to comment.