Upgrade bootstrap-datepicker.js to latest version
Upgrade required to fix bug where date selection from previous and next year was wrong. Closes-Bug: 1270884 Change-Id: I7cb6f7f5fd0a709cbf0c1325e832c92ec382b12c
This commit is contained in:
parent
e578ec1a33
commit
6e0a155a4d
|
@ -199,16 +199,20 @@
|
||||||
var nextMonth = new Date(prevMonth);
|
var nextMonth = new Date(prevMonth);
|
||||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
nextMonth.setDate(nextMonth.getDate() + 42);
|
||||||
nextMonth = nextMonth.valueOf();
|
nextMonth = nextMonth.valueOf();
|
||||||
html = [];
|
var html = [];
|
||||||
var clsName;
|
var clsName,
|
||||||
|
prevY,
|
||||||
|
prevM;
|
||||||
while(prevMonth.valueOf() < nextMonth) {
|
while(prevMonth.valueOf() < nextMonth) {
|
||||||
if (prevMonth.getDay() === this.weekStart) {
|
if (prevMonth.getDay() === this.weekStart) {
|
||||||
html.push('<tr>');
|
html.push('<tr>');
|
||||||
}
|
}
|
||||||
clsName = this.onRender(prevMonth);
|
clsName = this.onRender(prevMonth);
|
||||||
if (prevMonth.getMonth() < month) {
|
prevY = prevMonth.getFullYear();
|
||||||
|
prevM = prevMonth.getMonth();
|
||||||
|
if ((prevM < month && prevY === year) || prevY < year) {
|
||||||
clsName += ' old';
|
clsName += ' old';
|
||||||
} else if (prevMonth.getMonth() > month) {
|
} else if ((prevM > month && prevY === year) || prevY > year) {
|
||||||
clsName += ' new';
|
clsName += ' new';
|
||||||
}
|
}
|
||||||
if (prevMonth.valueOf() === currentDate) {
|
if (prevMonth.valueOf() === currentDate) {
|
||||||
|
|
Loading…
Reference in New Issue