META-INF.resources.primefaces.datepicker.0-datepicker.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primefaces Show documentation
Show all versions of primefaces Show documentation
PrimeFaces is one of the most popular UI libraries in Java EE Ecosystem and widely used by software companies, world renowned brands, banks, financial institutions, insurance companies, universities and more.
/**
* Prime DatePicker Widget
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = function (root, jQuery) {
factory(jQuery);
return jQuery;
};
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.widget("prime.datePicker", {
options: {
id: null,
name: null,
defaultDate: null,
viewDate: null,
style: null,
styleClass: null,
inline: false,
selectionMode: 'single',
inputId: null,
inputStyle: null,
inputStyleClass: null,
required: false,
readOnlyInput: false,
disabled: false,
tabIndex: null,
placeholder: null,
showIcon: false,
icon: 'ui-icon ui-icon-calendar',
showOnFocus: true,
keepInvalid: false,
numberOfMonths: 1,
view: 'date',
touchUI: false,
showTime: false,
timeOnly: false,
showSeconds: false,
hourFormat: '24',
stepHour: 1,
stepMinute: 1,
stepSecond: 1,
shortYearCutoff: '+10',
hideOnDateTimeSelect: false,
userLocale: null,
locale: {
firstDayOfWeek: 0,
dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: 'Today',
clear: 'Clear'
},
dateFormat: 'mm/dd/yy',
yearRange: null,
panelStyle: null,
panelStyleClass: null,
monthNavigator: false,
yearNavigator: false,
disabledDates: null,
disabledDays: null,
minDate: null,
maxDate: null,
maxDateCount: null,
showOtherMonths: false,
selectOtherMonths: false,
showButtonBar: false,
todayButtonStyleClass: 'ui-priority-secondary',
clearButtonStyleClass: 'ui-priority-secondary',
appendTo: null,
dateTemplate: null,
onFocus: null,
onBlur: null,
onInput: null,
onSelect: null,
onChange: null,
onViewDateChange: null,
onTodayButtonClick: null,
onClearButtonClick: null,
onBeforeShow: null,
onBeforeHide: null,
onMonthChange: null,
onYearChange: null
},
_create: function () {
this.container = this.element;
this.inputfield = this.element.children('input');
this._setInitValues();
this._render();
},
_setInitValues: function () {
var parsedDefaultDate = this.parseValue(this.options.defaultDate);
this.value = parsedDefaultDate;
this.viewDate = this.options.viewDate ?
this.parseValue(this.options.viewDate)
:
((((this.isMultipleSelection() || this.isRangeSelection()) && parsedDefaultDate instanceof Array) ? parsedDefaultDate[0] : parsedDefaultDate) || this.parseValue(new Date()));
this.options.minDate = this.parseOptionValue(this.options.minDate);
this.options.maxDate = this.parseOptionValue(this.options.maxDate);
this.ticksTo1970 = (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000);
if (this.options.userLocale && typeof this.options.userLocale === 'object') {
$.extend(this.options.locale, this.options.userLocale);
}
if (this.options.disabledDates) {
for (var i = 0; i < this.options.disabledDates.length; i++) {
this.options.disabledDates[i] = this.parseOptionValue(this.options.disabledDates[i]);
}
}
},
parseOptionValue: function(option) {
if (option && typeof option === 'string') {
return this.parseDate(option, this.options.dateFormat);
}
return option;
},
parseValue: function(option) {
if (option && typeof option === 'string') {
return this.parseValueFromString(option);
}
return option;
},
setDate: function(date) {
this.value = this.parseValue(date);
/* set changes */
this.panel.get(0).innerHTML = this.renderPanelElements();
this.inputfield.val(this.value);
},
getDate: function() {
return this.value;
},
getFirstDayOfMonthIndex: function (month, year) {
var day = new Date();
day.setDate(1);
day.setMonth(month);
day.setFullYear(year);
var dayIndex = day.getDay() + this.getSundayIndex();
return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
},
getSundayIndex: function () {
var firstDayOfWeek = this.options.locale.firstDay !== undefined ? this.options.locale.firstDay : this.options.locale.firstDayOfWeek;
return firstDayOfWeek > 0 ? 7 - firstDayOfWeek : 0;
},
getDaysCountInMonth: function (month, year) {
return 32 - this.daylightSavingAdjust(new Date(year, month, 32)).getDate();
},
getDaysCountInPrevMonth: function (month, year) {
var prev = this.getPreviousMonthAndYear(month, year);
return this.getDaysCountInMonth(prev.month, prev.year);
},
daylightSavingAdjust: function (date) {
if (!date) {
return null;
}
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
return date;
},
getPreviousMonthAndYear: function (month, year) {
var m, y;
if (month === 0) {
m = 11;
y = year - 1;
}
else {
m = month - 1;
y = year;
}
return { 'month': m, 'year': y };
},
getNextMonthAndYear: function (month, year) {
var m, y;
if (month === 11) {
m = 0;
y = year + 1;
}
else {
m = month + 1;
y = year;
}
return { 'month': m, 'year': y };
},
createWeekDays: function () {
var weekDays = [],
dayIndex = this.options.locale.firstDay !== undefined ? this.options.locale.firstDay : this.options.locale.firstDayOfWeek;
for (var i = 0; i < 7; i++) {
weekDays.push(this.options.locale.dayNamesMin[dayIndex]);
dayIndex = (dayIndex === 6) ? 0 : ++dayIndex;
}
return weekDays;
},
createMonths: function (month, year) {
var months = [];
for (var i = 0; i < this.options.numberOfMonths; i++) {
var m = month + i,
y = year;
if (m > 11) {
m = m % 11 - 1;
y = year + 1;
}
months.push(this.createMonth(m, y));
}
return months;
},
createMonth: function (month, year) {
var dates = [];
firstDay = this.getFirstDayOfMonthIndex(month, year);
daysLength = this.getDaysCountInMonth(month, year);
prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year);
dayNo = 1;
today = new Date();
for (var i = 0; i < 6; i++) {
var week = [];
if (i === 0) {
for (var j = (prevMonthDaysLength - firstDay + 1); j <= prevMonthDaysLength; j++) {
var prev = this.getPreviousMonthAndYear(month, year);
week.push({
day: j, month: prev.month, year: prev.year, otherMonth: true,
today: this.isToday(today, j, prev.month, prev.year), selectable: this.isSelectable(j, prev.month, prev.year, true)
});
}
var remainingDaysLength = 7 - week.length;
for (var j = 0; j < remainingDaysLength; j++) {
week.push({
day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
selectable: this.isSelectable(dayNo, month, year, false)
});
dayNo++;
}
}
else {
for (var j = 0; j < 7; j++) {
if (dayNo > daysLength) {
var next = this.getNextMonthAndYear(month, year);
week.push({
day: dayNo - daysLength, month: next.month, year: next.year, otherMonth: true,
today: this.isToday(today, dayNo - daysLength, next.month, next.year),
selectable: this.isSelectable((dayNo - daysLength), next.month, next.year, true)
});
}
else {
week.push({
day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
selectable: this.isSelectable(dayNo, month, year, false)
});
}
dayNo++;
}
}
dates.push(week);
}
return {
month: month,
year: year,
dates: dates
};
},
isSelectable: function (day, month, year, otherMonth) {
var validMin = true;
validMax = true;
validDate = true;
validDay = true;
validMonth = true;
if (this.options.minDate) {
if (this.options.minDate.getFullYear() > year) {
validMin = false;
}
else if (this.options.minDate.getFullYear() === year) {
if (this.options.minDate.getMonth() > month) {
validMin = false;
}
else if (this.options.minDate.getMonth() === month) {
if (this.options.minDate.getDate() > day) {
validMin = false;
}
}
}
}
if (this.options.maxDate) {
if (this.options.maxDate.getFullYear() < year) {
validMax = false;
}
else if (this.options.maxDate.getFullYear() === year) {
if (this.options.maxDate.getMonth() < month) {
validMax = false;
}
else if (this.options.maxDate.getMonth() === month) {
if (this.options.maxDate.getDate() < day) {
validMax = false;
}
}
}
}
if (this.options.disabledDates) {
validDate = !this.isDateDisabled(day, month, year);
}
if (this.options.disabledDays) {
validDay = !this.isDayDisabled(day, month, year)
}
if (this.options.selectOtherMonths === false && otherMonth) {
validMonth = false;
}
return validMin && validMax && validDate && validDay && validMonth;
},
isSelected: function (dateMeta) {
if (this.value) {
if (this.isSingleSelection()) {
return this.isDateEquals(this.value, dateMeta);
}
else if (this.isMultipleSelection()) {
var selected = false;
for (var i = 0; i < this.value.length; i++) {
var date = this.value[i];
selected = this.isDateEquals(date, dateMeta);
if (selected) {
break;
}
}
return selected;
}
else if (this.isRangeSelection()) {
if (this.value[1])
return this.isDateEquals(this.value[0], dateMeta) || this.isDateEquals(this.value[1], dateMeta) || this.isDateBetween(this.value[0], this.value[1], dateMeta);
else
return this.isDateEquals(this.value[0], dateMeta)
}
}
else {
return false;
}
},
isMonthSelected: function (month) {
return this.value ? (this.value.getMonth() === month && this.value.getFullYear() === this.viewDate.getFullYear()) : false;
},
isDateEquals: function (value, dateMeta) {
if (value && value instanceof Date)
return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
else
return false;
},
isDateBetween: function (start, end, dateMeta) {
var between = false;
if (start && end) {
var date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
}
return between;
},
isSingleSelection: function () {
return this.options.selectionMode === 'single';
},
isRangeSelection: function () {
return this.options.selectionMode === 'range';
},
isMultipleSelection: function () {
return this.options.selectionMode === 'multiple';
},
isToday: function (today, day, month, year) {
return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;
},
isDateDisabled: function (day, month, year) {
if (this.options.disabledDates) {
for (var i = 0; i < this.options.disabledDates.length; i++) {
var disabledDate = this.options.disabledDates[i];
if (disabledDate.getFullYear() === year && disabledDate.getMonth() === month && disabledDate.getDate() === day) {
return true;
}
}
}
return false;
},
isDayDisabled: function (day, month, year) {
if (this.options.disabledDays) {
var weekday = new Date(year, month, day),
weekdayNumber = weekday.getDay();
return this.options.disabledDays.indexOf(weekdayNumber) !== -1;
}
return false;
},
getValueToRender: function () {
var formattedValue = '';
if (this.value) {
try {
if (this.isSingleSelection()) {
formattedValue = this.formatDateTime(this.value);
}
else if (this.isMultipleSelection()) {
for (var i = 0; i < this.value.length; i++) {
var dateAsString = this.formatDateTime(this.value[i]);
formattedValue += dateAsString;
if (i !== (this.value.length - 1)) {
formattedValue += ', ';
}
}
}
else if (this.isRangeSelection()) {
if (this.value && this.value.length) {
var startDate = this.value[0],
endDate = this.value[1];
formattedValue = this.formatDateTime(startDate);
if (endDate) {
formattedValue += ' - ' + this.formatDateTime(endDate);
}
}
}
}
catch (err) {
formattedValue = this.value;
}
}
return formattedValue;
},
formatDateTime: function (date) {
var formattedValue = null;
if (date) {
if (this.options.timeOnly) {
formattedValue = this.formatTime(date);
}
else {
formattedValue = this.formatDate(date, this.options.dateFormat);
if (this.options.showTime) {
formattedValue += ' ' + this.formatTime(date);
}
}
}
return formattedValue;
},
// Ported from jquery-ui datepicker formatDate
formatDate: function (date, format) {
if (!date) {
return '';
}
var iFormat,
lookAhead = function (match) {
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
if (matches) {
iFormat++;
}
return matches;
},
formatNumber = function (match, value, len) {
var num = '' + value;
if (lookAhead(match)) {
while (num.length < len) {
num = '0' + num;
}
}
return num;
},
formatName = function (match, value, shortNames, longNames) {
return (lookAhead(match) ? longNames[value] : shortNames[value]);
};
var output = '',
literal = false;
if (date) {
for (iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) === '\'' && !lookAhead('\'')) {
literal = false;
} else {
output += format.charAt(iFormat);
}
} else {
switch (format.charAt(iFormat)) {
case 'd':
output += formatNumber('d', date.getDate(), 2);
break;
case 'D':
output += formatName('D', date.getDay(), this.options.locale.dayNamesShort, this.options.locale.dayNames);
break;
case 'o':
output += formatNumber('o',
Math.round((
new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -
new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
break;
case 'm':
output += formatNumber('m', date.getMonth() + 1, 2);
break;
case 'M':
output += formatName('M', date.getMonth(), this.options.locale.monthNamesShort, this.options.locale.monthNames);
break;
case 'y':
output += lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);
break;
case '@':
output += date.getTime();
break;
case '!':
output += date.getTime() * 10000 + this.ticksTo1970;
break;
case '\'':
if (lookAhead('\'')) {
output += '\'';
} else {
literal = true;
}
break;
default:
output += format.charAt(iFormat);
}
}
}
}
return output;
},
formatTime: function (date) {
if (!date) {
return '';
}
var output = '',
hours = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds();
if (this.options.hourFormat == '12' && hours > 11 && hours != 12) {
hours -= 12;
}
if (this.options.hourFormat == '12') {
output += hours === 0 ? 12 : (hours < 10) ? '0' + hours : hours;
} else {
output += (hours < 10) ? '0' + hours : hours;
}
output += ':';
output += (minutes < 10) ? '0' + minutes : minutes;
if (this.options.showSeconds) {
output += ':';
output += (seconds < 10) ? '0' + seconds : seconds;
}
if (this.options.hourFormat == '12') {
output += date.getHours() > 11 ? ' PM' : ' AM';
}
return output;
},
parseTime: function (value, ampm) {
var tokens = value.split(':'),
validTokenLength = this.options.showSeconds ? 3 : 2;
if (tokens.length !== validTokenLength) {
throw "Invalid time";
}
var h = parseInt(tokens[0]),
m = parseInt(tokens[1]),
s = this.options.showSeconds ? parseInt(tokens[2]) : null;
if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (this.options.hourFormat == '12' && h > 12) || (this.options.showSeconds && (isNaN(s) || s > 59))) {
throw "Invalid time";
}
else {
if (this.options.hourFormat == '12' && h !== 12 && ampm === 'PM') {
h += 12;
}
return { hour: h, minute: m, second: s };
}
},
// Ported from jquery-ui datepicker parseDate
parseDate: function (value, format) {
if (format == null || value == null) {
throw "Invalid arguments";
}
value = (typeof value === "object" ? value.toString() : value + "");
if (value === "") {
return null;
}
var iFormat, dim, extra,
iValue = 0,
shortYearCutoff = (typeof this.options.shortYearCutoff !== "string" ? this.options.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.options.shortYearCutoff, 10)),
year = -1,
month = -1,
day = -1,
doy = -1,
literal = false,
date,
lookAhead = function (match) {
var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
if (matches) {
iFormat++;
}
return matches;
},
getNumber = function (match) {
var isDoubled = lookAhead(match),
size = (match === "@" ? 14 : (match === "!" ? 20 :
(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
minSize = (match === "y" ? size : 1),
digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
num = value.substring(iValue).match(digits);
if (!num) {
throw "Missing number at position " + iValue;
}
iValue += num[0].length;
return parseInt(num[0], 10);
},
getName = function (match, shortNames, longNames) {
var index = -1,
arr = lookAhead(match) ? longNames : shortNames,
names = [];
for (var i = 0; i < arr.length; i++) {
names.push([i, arr[i]]);
}
names.sort(function (a, b) {
return -(a[1].length - b[1].length);
});
for (var i = 0; i < names.length; i++) {
var name = names[i][1];
if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
index = names[i][0];
iValue += name.length;
break;
}
}
if (index !== -1) {
return index + 1;
} else {
throw "Unknown name at position " + iValue;
}
},
checkLiteral = function() {
if (value.charAt(iValue) !== format.charAt(iFormat)) {
throw "Unexpected literal at position " + iValue;
}
iValue++;
};
if (this.options.view === 'month') {
day = 1;
}
for (iFormat = 0; iFormat < format.length; iFormat++) {
if (literal) {
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
literal = false;
} else {
checkLiteral();
}
} else {
switch (format.charAt(iFormat)) {
case "d":
day = getNumber("d");
break;
case "D":
getName("D", this.options.locale.dayNamesShort, this.options.locale.dayNames);
break;
case "o":
doy = getNumber("o");
break;
case "m":
month = getNumber("m");
break;
case "M":
month = getName("M", this.options.locale.monthNamesShort, this.options.locale.monthNames);
break;
case "y":
year = getNumber("y");
break;
case "@":
date = new Date(getNumber("@"));
year = date.getFullYear();
month = date.getMonth() + 1;
day = date.getDate();
break;
case "!":
date = new Date((getNumber("!") - this.ticksTo1970) / 10000);
year = date.getFullYear();
month = date.getMonth() + 1;
day = date.getDate();
break;
case "'":
if (lookAhead("'")) {
checkLiteral();
} else {
literal = true;
}
break;
default:
checkLiteral();
}
}
}
if (iValue < value.length) {
extra = value.substr(iValue);
if (!/^\s+/.test(extra)) {
throw "Extra/unparsed characters found in date: " + extra;
}
}
if (year === -1) {
year = new Date().getFullYear();
} else if (year < 100) {
year += new Date().getFullYear() - new Date().getFullYear() % 100 +
(year <= shortYearCutoff ? 0 : -100);
}
if (doy > -1) {
month = 1;
day = doy;
do {
dim = this.getDaysCountInMonth(year, month - 1);
if (day <= dim) {
break;
}
month++;
day -= dim;
} while (true);
}
date = this.daylightSavingAdjust(new Date(year, month - 1, day));
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
throw "Invalid date"; // E.g. 31/02/00
}
return date;
},
parseValueFromString: function (text) {
if (!text || text.trim().length === 0) {
return null;
}
var value;
if (this.isSingleSelection()) {
value = this.parseDateTime(text);
}
else if (this.isMultipleSelection()) {
var tokens = text.split(',');
value = [];
for (var i = 0; i < tokens.length; i++) {
value.push(this.parseDateTime(tokens[i].trim()));
}
}
else if (this.isRangeSelection()) {
var tokens = text.split(/-| - /);
value = [];
for (var i = 0; i < tokens.length; i++) {
value[i] = this.parseDateTime(tokens[i].trim());
}
}
return value;
},
parseDateTime: function (text) {
var date,
parts = text.split(' ');
if (this.options.timeOnly) {
date = new Date();
this.populateTime(date, parts[0], parts[1]);
}
else {
if (this.options.showTime) {
date = this.parseDate(parts[0], this.options.dateFormat);
this.populateTime(date, parts[1], parts[2]);
}
else {
date = this.parseDate(text, this.options.dateFormat);
}
}
return date;
},
populateTime: function (value, timeString, ampm) {
if (this.options.hourFormat === '12' && (ampm !== 'PM' && ampm !== 'AM')) {
throw new Error('Invalid Time');
}
var time = this.parseTime(timeString, ampm);
value.setHours(time.hour);
value.setMinutes(time.minute);
value.setSeconds(time.second);
},
_destroy: function () {
this.restoreOverlayAppend();
this.onOverlayHide();
},
_render: function () {
if (this.options.styleClass) {
this.container.addClass(this.options.styleClass);
}
if (this.options.style) {
this.container.attr('style', this.options.style);
}
if (!this.options.inline) {
if (this.options.inputStyleClass) {
this.inputfield.addClass(this.options.inputStyleClass);
}
if (this.options.inputStyle) {
this.inputfield.attr('style', this.options.inputStyle);
}
}
if (this.options.showIcon && !this.options.inline) {
if (this.triggerButton) {
this.triggerButton.remove();
}
this.renderTriggerButton();
this.container.append(this.triggerButton);
this.container.addClass('ui-trigger-calendar')
}
if (this.panel) {
this.panel.remove();
}
this.renderDatePickerPanel();
this.panel.css({
'display': this.options.inline ? 'block' : 'none',
'position': this.options.inline || this.options.touchUI ? '' : 'absolute'
});
if (this.options.panelStyleClass) {
this.panel.addClass(this.options.panelStyleClass);
}
if (this.options.panelStyle) {
this.panel.attr('style', this.options.panelStyle);
}
if (this.options.appendTo) {
this.panel.appendTo(this.options.appendTo);
}
else {
this.panel.appendTo(this.container);
}
this._setInitOptionValues();
this._bindEvents();
},
_setInitOptionValues: function () {
if (this.options.yearNavigator) {
this.panel.find('.ui-datepicker-header > .ui-datepicker-title > .ui-datepicker-year').val(this.viewDate.getFullYear());
}
if (this.options.monthNavigator && this.options.view !== 'month') {
this.panel.find('.ui-datepicker-header > .ui-datepicker-title > .ui-datepicker-month').val(this.viewDate.getMonth());
}
},
renderTriggerButton: function () {
this.triggerButton = $('');
},
renderDatePickerPanel: function () {
//add classes according to conditions
var _classes = this.getClassesToAdd({
'ui-datepicker-inline': this.options.inline,
'ui-shadow': !this.options.inline,
'ui-input-overlay': !this.options.inline,
'ui-state-disabled': this.options.disabled,
'ui-datepicker-timeonly': this.options.timeOnly,
'ui-datepicker-multiple-month': this.options.numberOfMonths > 1,
'ui-datepicker-monthpicker': (this.options.view === 'month'),
'ui-datepicker-touch-ui': this.options.touchUI
});
this.panel = $('');
//render inner elements
this.panel.get(0).innerHTML = this.renderPanelElements();
},
renderPanelElements: function () {
var elementsHtml = '';
if (!this.options.timeOnly) {
if (this.options.view == 'date') {
elementsHtml += this.renderDateView();
}
else if (this.options.view == 'month') {
elementsHtml += this.renderMonthView();
}
}
if (this.options.showTime || this.options.timeOnly) {
elementsHtml += this.renderTimePicker();
}
if (this.options.showButtonBar) {
elementsHtml += this.renderButtonBar();
}
return elementsHtml;
},
renderDateView: function () {
this.monthsMetaData = this.createMonths(this.viewDate.getMonth(), this.viewDate.getFullYear());
var months = this.renderMonths(this.monthsMetaData);
return months;
},
renderMonthView: function () {
var backwardNavigator = this.renderBackwardNavigator(),
forwardNavigator = this.renderForwardNavigator(),
yearElement = this.renderTitleYearElement(this.viewDate.getFullYear()),
months = this.renderMonthViewMonths();
return ('' +
months +
'' +
'
' +
'