Skip to content

Commit 6e98cfa

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent c8baa60 commit 6e98cfa

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

src/kendo.calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ var __meta__ = { // jshint ignore:line
11221122
currentValue = new DATE(+that._current);
11231123

11241124
if (that._isMultipleSelection()) {
1125-
var firstDayCurrentMonth = that._table.find("td:not(.k-other-month)").has(".k-link").first();
1125+
var firstDayCurrentMonth = that._table.find("td:not(.k-other-month):not(.k-out-of-range)").has(".k-link").first();
11261126
currentValue = toDateObject(firstDayCurrentMonth.find("a"));
11271127
that._current = new Date(+currentValue);
11281128
}

src/kendo.core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,11 +1669,12 @@ function pad(number, digits, end) {
16691669
var width = element[0].style.width,
16701670
height = element[0].style.height,
16711671
percentWidth = percentRegExp.test(width),
1672-
percentHeight = percentRegExp.test(height);
1672+
percentHeight = percentRegExp.test(height),
1673+
forceWidth = element.hasClass("k-tooltip") || element.is(".k-menu-horizontal.k-context-menu");
16731674

16741675
percentage = percentWidth || percentHeight;
16751676

1676-
if (!percentWidth && (!autosize || (autosize && width) || element.hasClass("k-tooltip"))) { width = autosize ? outerWidth(element) + 1 : outerWidth(element); }
1677+
if (!percentWidth && (!autosize || (autosize && width) || forceWidth)) { width = autosize ? outerWidth(element) + 1 : outerWidth(element); }
16771678
if (!percentHeight && (!autosize || (autosize && height))) { height = outerHeight(element); }
16781679

16791680
element.wrap(

src/kendo.datepicker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ var __meta__ = { // jshint ignore:line
262262
_click: function(e) {
263263

264264
if (e.currentTarget.className.indexOf(SELECTED) !== -1) {
265+
this.calendar.trigger("change");
265266
this.close();
266267
}
267268
},

tests/calendar/api.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,5 +907,17 @@ it("selectDates selects empty array", function() {
907907
assert.deepEqual(calendar.selectDates(), []);
908908
});
909909

910+
it("calling navigateToFuture does not throw error", function() {
911+
var calendar = new Calendar(div, {
912+
start: "century",
913+
selectable: "multiple"
914+
});
915+
916+
calendar.navigateToPast();
917+
calendar.navigateToFuture();
918+
919+
assert.isOk(calendar._current);
920+
});
921+
910922
});
911923
}());

tests/datepicker/navigation.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,23 @@ it("click on selected date should close the dateView", function() {
688688
.click();
689689
});
690690

691+
it("click on selected date should populate input if empty", function() {
692+
datepicker = input.kendoDatePicker({
693+
value: new Date(2019, 1, 1)
694+
}).data("kendoDatePicker");
695+
696+
datepicker.open();
697+
698+
input.val("");
699+
700+
datepicker.dateView.calendar
701+
.element
702+
.find(".k-state-selected")
703+
.click();
704+
705+
assert.isOk(input.val());
706+
});
707+
691708
it("Spacebar should not select a date and close the popup", function() {
692709
var event = { keyCode: keys.SPACEBAR, preventDefault: $.noop };
693710

0 commit comments

Comments
 (0)