plugins/calendar.js
function(offset) {

			var monthNum = this.month
			offset = offset || 0
			monthNum += offset

			if(monthNum < 0) { monthNum = 11 }
			if(monthNum > 11) { monthNum = 0 }
			var month = this.getOffsetMonth(offset)
				, year = this.getOffsetYear(offset)

			// get the first day of the month we are currently viewing
			var firstOfMonth = new Date(year, month, 1).getDay(),
	
			// get the total number of days in the month we are currently viewing
			numDays = this.offsetDaysInMonth(offset),
	
			// declare our day counter
			dayCount = 0,
	
			html = '',
	
			row = '<tr>'
			
			// print out previous month's "days"
			for(i = 1; i <= firstOfMonth; i++) {
				row += '<td>&nbsp;</td>'
				dayCount++
			}
	
			for(i = 1; i <= numDays; i++) {
				// if we have reached the end of a week, wrap to the next line
				if(dayCount == 7) {
					row += '</tr>'
					html += row
					row = '<tr>'
					dayCount = 0
				}

				// output the text that goes inside each td
				// if the day is the current day, add a class of "selected"
				// Only show a default date if the selection mode is 'single'
				row += '<td data-day="' + i + '" class=""><a href="#">' + i + '</a></td>'
				dayCount++
			}
			
			// if we haven't finished at the end of the week, start writing out the "days" for the next month
			for(i = 1; i <= (7 - dayCount); i++) {
				row += '<td>&nbsp;</td>'
			}
	
			html += row
			
			return html
		}
function(offset) {

			var monthNum = this.month
			offset = offset || 0
			monthNum += offset

			if(monthNum < 0) { monthNum = 11 }
			if(monthNum > 11) { monthNum = 0 }
			var month = this.getOffsetMonth(offset)
				, year = this.getOffsetYear(offset)

			// get the first day of the month we are currently viewing
			var firstOfMonth = new Date(year, month, 1).getDay(),
	
			// get the total number of days in the month we are currently viewing
			numDays = this.offsetDaysInMonth(offset),
	
			// declare our day counter
			dayCount = 0,
	
			html = '',
	
			row = '<tr>'
			
			// print out previous month's "days"
			for(i = 1; i <= firstOfMonth; i++) {
				row += '<td>&nbsp;</td>'
				dayCount++
			}
	
			for(i = 1; i <= numDays; i++) {
				// if we have reached the end of a week, wrap to the next line
				if(dayCount == 7) {
					row += '</tr>'
					html += row
					row = '<tr>'
					dayCount = 0
				}

				// output the text that goes inside each td
				// if the day is the current day, add a class of "selected"
				// Only show a default date if the selection mode is 'single'
				row += '<td data-day="' + i + '" class=""><a href="#">' + i + '</a></td>'
				dayCount++
			}
			
			// if we haven't finished at the end of the week, start writing out the "days" for the next month
			for(i = 1; i <= (7 - dayCount); i++) {
				row += '<td>&nbsp;</td>'
			}
	
			html += row
			
			return html
		}
function ( offset ) { var monthNum = this . month offset = offset || 0 monthNum += offset if ( monthNum < 0 ) { monthNum = 11 } if ( monthNum > 11 ) { monthNum = 0 } var month = this . getOffsetMonth ( offset ) , year = this . getOffsetYear ( offset ) // get the first day of the month we are currently viewing var firstOfMonth = new Date ( year , month , 1 ) . getDay ( ) , // get the total number of days in the month we are currently viewing numDays = this . offsetDaysInMonth ( offset ) , // declare our day counter dayCount = 0 , html = '' , row = '<tr>' // print out previous month's "days" for ( i = 1 ; i <= firstOfMonth ; i ++ ) { row += '<td>&nbsp;</td>' dayCount ++ } for ( i = 1 ; i <= numDays ; i ++ ) { // if we have reached the end of a week, wrap to the next line if ( dayCount == 7 ) { row += '</tr>' html += row row = '<tr>' dayCount = 0 } // output the text that goes inside each td // if the day is the current day, add a class of "selected" // Only show a default date if the selection mode is 'single' row += '<td data-day="' + i + '" class=""><a href="#">' + i + '</a></td>' dayCount ++ } // if we haven't finished at the end of the week, start writing out the "days" for the next month for ( i = 1 ; i <= ( 7 - dayCount ) ; i ++ ) { row += '<td>&nbsp;</td>' } html += row return html }
Builds calendar markup
@param integer month offset
Builds calendar markup