aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.datepicker.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index 1a64b0b5c..391b45087 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -595,6 +595,24 @@ $.extend(Datepicker.prototype, {
.trigger('mouseover')
.end();
var numMonths = this._getNumberOfMonths(inst);
+ var months = this._get(inst, 'numberOfMonths');
+ var multi = '';
+ if (months > 1) {
+ if (months % 4 == 0) {
+ multi = 'ui-datepicker-multi-4';
+ inst.dpDiv.css('width','60em');
+ } else if (months % 3 == 0) {
+ multi = 'ui-datepicker-multi-3';
+ inst.dpDiv.css('width','51em');
+ } else if (months % 2 == 0) {
+ multi = 'ui-datepicker-multi-2';
+ inst.dpDiv.css('width','34em');
+ }
+ inst.dpDiv.addClass(multi);
+ } else {
+ inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4');
+ inst.dpDiv.width('');
+ }
inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
'Class']('ui-datepicker-multi');
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +