');
+ }
+ }
+ clsName = '';
+ if (prevMonth.year() < year || (prevMonth.year() === year && prevMonth.month() < month)) {
+ clsName += ' old';
+ } else if (prevMonth.year() > year || (prevMonth.year() === year && prevMonth.month() > month)) {
+ clsName += ' new';
+ }
+ if (prevMonth.isSame(moment({y: picker.date.year(), M: picker.date.month(), d: picker.date.date()}))) {
+ clsName += ' active';
+ }
+ if (isInDisableDates(prevMonth, 'day') || !isInEnableDates(prevMonth)) {
+ clsName += ' disabled';
+ }
+ if (picker.options.showToday === true) {
+ if (prevMonth.isSame(moment(), 'day')) {
+ clsName += ' today';
+ }
+ }
+ if (picker.options.daysOfWeekDisabled) {
+ for (i = 0; i < picker.options.daysOfWeekDisabled.length; i++) {
+ if (prevMonth.day() === picker.options.daysOfWeekDisabled[i]) {
+ clsName += ' disabled';
+ break;
+ }
+ }
+ }
+ row.append('
' + prevMonth.date() + '
');
+
+ currentDate = prevMonth.date();
+ prevMonth.add(1, 'd');
+
+ if (currentDate === prevMonth.date()) {
+ prevMonth.add(1, 'd');
+ }
+ }
+ picker.widget.find('.datepicker-days tbody').empty().append(html);
+ currentYear = picker.date.year();
+ months = picker.widget.find('.datepicker-months').find('th:eq(1)').text(year).end().find('span').removeClass('active');
+ if (currentYear === year) {
+ months.eq(picker.date.month()).addClass('active');
+ }
+ if (year - 1 < startYear) {
+ picker.widget.find('.datepicker-months th:eq(0)').addClass('disabled');
+ }
+ if (year + 1 > endYear) {
+ picker.widget.find('.datepicker-months th:eq(2)').addClass('disabled');
+ }
+ for (i = 0; i < 12; i++) {
+ if ((year === startYear && startMonth > i) || (year < startYear)) {
+ $(months[i]).addClass('disabled');
+ } else if ((year === endYear && endMonth < i) || (year > endYear)) {
+ $(months[i]).addClass('disabled');
+ }
+ }
+
+ html = '';
+ year = parseInt(year / 10, 10) * 10;
+ yearCont = picker.widget.find('.datepicker-years').find(
+ 'th:eq(1)').text(year + '-' + (year + 9)).parents('table').find('td');
+ picker.widget.find('.datepicker-years').find('th').removeClass('disabled');
+ if (startYear > year) {
+ picker.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled');
+ }
+ if (endYear < year + 9) {
+ picker.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled');
+ }
+ year -= 1;
+ for (i = -1; i < 11; i++) {
+ html += '' + year + '';
+ year += 1;
+ }
+ yearCont.html(html);
+ },
+
+ fillHours = function () {
+ moment.locale(picker.options.language);
+ var table = picker.widget.find('.timepicker .timepicker-hours table'), html = '', current, i, j;
+ table.parent().hide();
+ if (picker.use24hours) {
+ current = 0;
+ for (i = 0; i < 6; i += 1) {
+ html += '
';
+ for (j = 0; j < 4; j += 1) {
+ html += '
' + padLeft(current.toString()) + '
';
+ current++;
+ }
+ html += '
';
+ }
+ }
+ else {
+ current = 1;
+ for (i = 0; i < 3; i += 1) {
+ html += '
';
+ for (j = 0; j < 4; j += 1) {
+ html += '
' + padLeft(current.toString()) + '
';
+ current++;
+ }
+ html += '
';
+ }
+ }
+ table.html(html);
+ },
+
+ fillMinutes = function () {
+ var table = picker.widget.find('.timepicker .timepicker-minutes table'), html = '', current = 0, i, j, step = picker.options.minuteStepping;
+ table.parent().hide();
+ if (step === 1) {
+ step = 5;
+ }
+ for (i = 0; i < Math.ceil(60 / step / 4) ; i++) {
+ html += '
';
+ for (j = 0; j < 4; j += 1) {
+ if (current < 60) {
+ html += '
' + padLeft(current.toString()) + '
';
+ current += step;
+ } else {
+ html += '
';
+ }
+ }
+ html += '
';
+ }
+ table.html(html);
+ },
+
+ fillSeconds = function () {
+ var table = picker.widget.find('.timepicker .timepicker-seconds table'), html = '', current = 0, i, j;
+ table.parent().hide();
+ for (i = 0; i < 3; i++) {
+ html += '