Commit c4eb198f authored by Ilya's avatar Ilya
Browse files

fix year picker for currentYear out of years range

parent 29f967dd
......@@ -751,8 +751,8 @@
var years = this._sDialog.years,
currentYear = this._sDialog.tDate.year(),
docfrag = document.createDocumentFragment(),
past = this._past.year(),
future = this._future.year();
past = Math.min(currentYear, this._past.year()),
future = Math.max(currentYear, this._future.year())
for (var year = past; year <= future; year++) {
var li = document.createElement('li');
......
This diff is collapsed.
......@@ -764,8 +764,9 @@ class mdDateTimePicker {
const years = this._sDialog.years
const currentYear = this._sDialog.tDate.year()
const docfrag = document.createDocumentFragment()
const past = this._past.year()
const future = this._future.year()
const past = Math.min(currentYear, this._past.year())
const future = Math.max(currentYear, this._future.year())
for (let year = past; year <= future; year++) {
const li = document.createElement('li')
li.textContent = year
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment