jquery-src/jquery.calendars.picker.js
function(elem, inst) {
			if (inst.options.autoSize && !inst.inline) {
				var calendar = inst.options.calendar;
				var date = calendar.newDate(2009, 10, 20); // Ensure double digits
				var dateFormat = inst.get('dateFormat');
				if (dateFormat.match(/[DM]/)) {
					var findMax = function(names) {
						var max = 0;
						var maxI = 0;
						for (var i = 0; i < names.length; i++) {
							if (names[i].length > max) {
								max = names[i].length;
								maxI = i;
							}
						}
						return maxI;
					};
					date.month(findMax(calendar.local[dateFormat.match(/MM/) ? // Longest month
						'monthNames' : 'monthNamesShort']) + 1);
					date.day(findMax(calendar.local[dateFormat.match(/DD/) ? // Longest day
						'dayNames' : 'dayNamesShort']) + 20 - date.dayOfWeek());
				}
				inst.elem.attr('size', date.formatDate(dateFormat,
					{localNumbers: inst.options.localnumbers}).length);
			}
		}
function(elem, inst) {
			if (inst.options.autoSize && !inst.inline) {
				var calendar = inst.options.calendar;
				var date = calendar.newDate(2009, 10, 20); // Ensure double digits
				var dateFormat = inst.get('dateFormat');
				if (dateFormat.match(/[DM]/)) {
					var findMax = function(names) {
						var max = 0;
						var maxI = 0;
						for (var i = 0; i < names.length; i++) {
							if (names[i].length > max) {
								max = names[i].length;
								maxI = i;
							}
						}
						return maxI;
					};
					date.month(findMax(calendar.local[dateFormat.match(/MM/) ? // Longest month
						'monthNames' : 'monthNamesShort']) + 1);
					date.day(findMax(calendar.local[dateFormat.match(/DD/) ? // Longest day
						'dayNames' : 'dayNamesShort']) + 20 - date.dayOfWeek());
				}
				inst.elem.attr('size', date.formatDate(dateFormat,
					{localNumbers: inst.options.localnumbers}).length);
			}
		}
function ( elem , inst ) { if ( inst . options . autoSize && ! inst . inline ) { var calendar = inst . options . calendar ; var date = calendar . newDate ( 2009 , 10 , 20 ) ; // Ensure double digits var dateFormat = inst . get ( 'dateFormat' ) ; if ( dateFormat . match ( / [DM] / ) ) { var findMax = function ( names ) { var max = 0 ; var maxI = 0 ; for ( var i = 0 ; i < names . length ; i ++ ) { if ( names [ i ] . length > max ) { max = names [ i ] . length ; maxI = i ; } } return maxI ; } ; date . month ( findMax ( calendar . local [ dateFormat . match ( / MM / ) ? // Longest month 'monthNames' : 'monthNamesShort' ] ) + 1 ) ; date . day ( findMax ( calendar . local [ dateFormat . match ( / DD / ) ? // Longest day 'dayNames' : 'dayNamesShort' ] ) + 20 - date . dayOfWeek ( ) ) ; } inst . elem . attr ( 'size' , date . formatDate ( dateFormat , { localNumbers : inst . options . localnumbers } ) . length ) ; } }
Apply the maximum length for the date format.
@memberof CalendarsPicker
@private
@param elem {jQuery} The control to affect.
@param inst {object} The current instance settings.
Apply the maximum length for the date format .