function(inst, drawMonth, drawYear, minDate, maxDate,
			secondary, monthNames, monthNamesShort) {

		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
			changeMonth = this._get(inst, "changeMonth"),
			changeYear = this._get(inst, "changeYear"),
			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
			html = "<div class='ui-datepicker-title'>",
			monthHtml = "";

		// month selection
		if (secondary || !changeMonth) {
			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
		} else {
			inMinYear = (minDate && minDate.getFullYear() === drawYear);
			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
			for ( month = 0; month < 12; month++) {
				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
					monthHtml += "<option value='" + month + "'" +
						(month === drawMonth ? " selected='selected'" : "") +
						">" + monthNamesShort[month] + "</option>";
				}
			}
			monthHtml += "</select>";
		}

		if (!showMonthAfterYear) {
			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
		}

		// year selection
		if ( !inst.yearshtml ) {
			inst.yearshtml = "";
			if (secondary || !changeYear) {
				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
			} else {
				// determine range of years to display
				years = this._get(inst, "yearRange").split(":");
				thisYear = new Date().getFullYear();
				determineYear = function(value) {
					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
						parseInt(value, 10)));
					return (isNaN(year) ? thisYear : year);
				};
				year = determineYear(years[0]);
				endYear = Math.max(year, determineYear(years[1] || ""));
				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
				for (; year <= endYear; year++) {
					inst.yearshtml += "<option value='" + year + "'" +
						(year === drawYear ? " selected='selected'" : "") +
						">" + year + "</option>";
				}
				inst.yearshtml += "</select>";

				html += inst.yearshtml;
				inst.yearshtml = null;
			}
		}

		html += this._get(inst, "yearSuffix");
		if (showMonthAfterYear) {
			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
		}
		html += "</div>"; // Close datepicker_header
		return html;
	}
function(inst, drawMonth, drawYear, minDate, maxDate,
			secondary, monthNames, monthNamesShort) {

		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
			changeMonth = this._get(inst, "changeMonth"),
			changeYear = this._get(inst, "changeYear"),
			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
			html = "<div class='ui-datepicker-title'>",
			monthHtml = "";

		// month selection
		if (secondary || !changeMonth) {
			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
		} else {
			inMinYear = (minDate && minDate.getFullYear() === drawYear);
			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
			for ( month = 0; month < 12; month++) {
				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
					monthHtml += "<option value='" + month + "'" +
						(month === drawMonth ? " selected='selected'" : "") +
						">" + monthNamesShort[month] + "</option>";
				}
			}
			monthHtml += "</select>";
		}

		if (!showMonthAfterYear) {
			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
		}

		// year selection
		if ( !inst.yearshtml ) {
			inst.yearshtml = "";
			if (secondary || !changeYear) {
				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
			} else {
				// determine range of years to display
				years = this._get(inst, "yearRange").split(":");
				thisYear = new Date().getFullYear();
				determineYear = function(value) {
					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
						parseInt(value, 10)));
					return (isNaN(year) ? thisYear : year);
				};
				year = determineYear(years[0]);
				endYear = Math.max(year, determineYear(years[1] || ""));
				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
				for (; year <= endYear; year++) {
					inst.yearshtml += "<option value='" + year + "'" +
						(year === drawYear ? " selected='selected'" : "") +
						">" + year + "</option>";
				}
				inst.yearshtml += "</select>";

				html += inst.yearshtml;
				inst.yearshtml = null;
			}
		}

		html += this._get(inst, "yearSuffix");
		if (showMonthAfterYear) {
			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
		}
		html += "</div>"; // Close datepicker_header
		return html;
	}
function ( inst , drawMonth , drawYear , minDate , maxDate , secondary , monthNames , monthNamesShort ) { var inMinYear , inMaxYear , month , years , thisYear , determineYear , year , endYear , changeMonth = this . _get ( inst , "changeMonth" ) , changeYear = this . _get ( inst , "changeYear" ) , showMonthAfterYear = this . _get ( inst , "showMonthAfterYear" ) , html = "<div class='ui-datepicker-title'>" , monthHtml = "" ; // month selection if ( secondary || ! changeMonth ) { monthHtml += "<span class='ui-datepicker-month'>" + monthNames [ drawMonth ] + "</span>" ; } else { inMinYear = ( minDate && minDate . getFullYear ( ) === drawYear ) ; inMaxYear = ( maxDate && maxDate . getFullYear ( ) === drawYear ) ; monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>" ; for ( month = 0 ; month < 12 ; month ++ ) { if ( ( ! inMinYear || month >= minDate . getMonth ( ) ) && ( ! inMaxYear || month <= maxDate . getMonth ( ) ) ) { monthHtml += "<option value='" + month + "'" + ( month === drawMonth ? " selected='selected'" : "" ) + ">" + monthNamesShort [ month ] + "</option>" ; } } monthHtml += "</select>" ; } if ( ! showMonthAfterYear ) { html += monthHtml + ( secondary || ! ( changeMonth && changeYear ) ? "&#xa0;" : "" ) ; } // year selection if ( ! inst . yearshtml ) { inst . yearshtml = "" ; if ( secondary || ! changeYear ) { html += "<span class='ui-datepicker-year'>" + drawYear + "</span>" ; } else { // determine range of years to display years = this . _get ( inst , "yearRange" ) . split ( ":" ) ; thisYear = new Date ( ) . getFullYear ( ) ; determineYear = function ( value ) { var year = ( value . match ( / c[+\-].* / ) ? drawYear + parseInt ( value . substring ( 1 ) , 10 ) : ( value . match ( / [+\-].* / ) ? thisYear + parseInt ( value , 10 ) : parseInt ( value , 10 ) ) ) ; return ( isNaN ( year ) ? thisYear : year ) ; } ; year = determineYear ( years [ 0 ] ) ; endYear = Math . max ( year , determineYear ( years [ 1 ] || "" ) ) ; year = ( minDate ? Math . max ( year , minDate . getFullYear ( ) ) : year ) ; endYear = ( maxDate ? Math . min ( endYear , maxDate . getFullYear ( ) ) : endYear ) ; inst . yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>" ; for ( ; year <= endYear ; year ++ ) { inst . yearshtml += "<option value='" + year + "'" + ( year === drawYear ? " selected='selected'" : "" ) + ">" + year + "</option>" ; } inst . yearshtml += "</select>" ; html += inst . yearshtml ; inst . yearshtml = null ; } } html += this . _get ( inst , "yearSuffix" ) ; if ( showMonthAfterYear ) { html += ( secondary || ! ( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml ; } html += "</div>" ; // Close datepicker_header return html ; }
/* Generate the month and year header.
/ * Generate the month and year header .
Generates the html for the calendar calendar