После проверки кода я заметил, что нет способа сделать это без взлома кода.Поэтому я добавил опцию, чтобы она всегда использовала шесть строк, и этого достаточно, независимо от того, какой месяц показывается.Вот патч на случай, если кто-то еще сочтет его полезным.
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index ed02335..87dafd4 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -104,7 +104,8 @@ function Datepicker() {
altFormat: '', // The date format to use for the alternate field
constrainInput: true, // The input is constrained by the current date format
showButtonPanel: false, // True to show button panel, false to not show it
- autoSize: false // True to size the input for the date format, false to leave as is
+ autoSize: false, // True to size the input for the date format, false to leave as is
+ unifyNumRows: false, // True to always use six rows; ensuring datepickers showing different months having the same height
};
$.extend(this._defaults, this.regional['']);
this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>');
@@ -1457,6 +1458,7 @@ $.extend(Datepicker.prototype, {
var showOtherMonths = this._get(inst, 'showOtherMonths');
var selectOtherMonths = this._get(inst, 'selectOtherMonths');
var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
+ var unifyNumRows = this._get(inst, 'unifyNumRows');
var defaultDate = this._getDefaultDate(inst);
var html = '';
for (var row = 0; row < numMonths[0]; row++) {
@@ -1495,7 +1497,7 @@ $.extend(Datepicker.prototype, {
if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
+ var numRows = ((isMultiMonth || unifyNumRows) ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
calender += '<tr>';
Если вам не нужен вариант, просто замените
var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7));
на
var numRows = 6;