datepicker: fix arrow click after clear date
This commit is contained in:
parent
48eff4a33d
commit
5c1ebaaf5e
@ -4,6 +4,7 @@ X-editable changelog
|
||||
|
||||
Version 1.2.1 wip
|
||||
----------------------------
|
||||
[bug] datepicker: error when click on arrows after clear date (vitalets)
|
||||
[enh] 'hidden' event: added possible value of reason param - 'nochange'. Occurs when form is submitted but value was not changed (vitalets)
|
||||
[enh] 'submit' method changed: error-callback's parameter simplified (vitalets)
|
||||
[enh] 'submit' method changed: now when response 200 OK it does not set pk automatically (vitalets)
|
||||
|
@ -286,7 +286,7 @@
|
||||
startMonth = this.startDate !== -Infinity ? this.startDate.getUTCMonth() : -Infinity,
|
||||
endYear = this.endDate !== Infinity ? this.endDate.getUTCFullYear() : Infinity,
|
||||
endMonth = this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity,
|
||||
currentDate = this.date.valueOf(),
|
||||
currentDate = this.date && this.date.valueOf(),
|
||||
today = new Date();
|
||||
this.picker.find('.datepicker-days thead th:eq(1)')
|
||||
.text(dates[this.language].months[month]+' '+year);
|
||||
@ -321,7 +321,7 @@
|
||||
prevMonth.getUTCDate() == today.getDate()) {
|
||||
clsName += ' today';
|
||||
}
|
||||
if (prevMonth.valueOf() == currentDate) {
|
||||
if (currentDate && prevMonth.valueOf() == currentDate) {
|
||||
clsName += ' active';
|
||||
}
|
||||
if (prevMonth.valueOf() < this.startDate || prevMonth.valueOf() > this.endDate) {
|
||||
@ -334,14 +334,14 @@
|
||||
prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
|
||||
}
|
||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
var currentYear = this.date.getUTCFullYear();
|
||||
var currentYear = this.date && this.date.getUTCFullYear();
|
||||
|
||||
var months = this.picker.find('.datepicker-months')
|
||||
.find('th:eq(1)')
|
||||
.text(year)
|
||||
.end()
|
||||
.find('span').removeClass('active');
|
||||
if (currentYear == year) {
|
||||
if (currentYear && currentYear == year) {
|
||||
months.eq(this.date.getUTCMonth()).addClass('active');
|
||||
}
|
||||
if (year < startYear || year > endYear) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user