').addClass('picker-switch' + (options.collapse ? ' accordion-toggle' : '')).append(getToolbar());
+
+ if (options.inline) {
+ template.removeClass('dropdown-menu');
+ }
+
+ if (use24Hours) {
+ template.addClass('usetwentyfour');
+ }
+ if (options.sideBySide && hasDate() && hasTime()) {
+ template.addClass('timepicker-sbs');
+ template.append(
+ $('').addClass('row')
+ .append(dateView.addClass('col-sm-6'))
+ .append(timeView.addClass('col-sm-6'))
+ );
+ template.append(toolbar);
+ return template;
+ }
+
+ if (options.toolbarPlacement === 'top') {
+ content.append(toolbar);
+ }
+ if (hasDate()) {
+ content.append($('
').addClass((options.collapse && hasTime() ? 'collapse in' : '')).append(dateView));
+ }
+ if (options.toolbarPlacement === 'default') {
+ content.append(toolbar);
+ }
+ if (hasTime()) {
+ content.append($('').addClass((options.collapse && hasDate() ? 'collapse' : '')).append(timeView));
+ }
+ if (options.toolbarPlacement === 'bottom') {
+ content.append(toolbar);
+ }
+ return template.append(content);
+ },
+
+ dataToOptions = function () {
+ var eData,
+ dataOptions = {};
+
+ if (element.is('input') || options.inline) {
+ eData = element.data();
+ } else {
+ eData = element.find('input').data();
+ }
+
+ if (eData.dateOptions && eData.dateOptions instanceof Object) {
+ dataOptions = $.extend(true, dataOptions, eData.dateOptions);
+ }
+
+ $.each(options, function (key) {
+ var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1);
+ if (eData[attributeName] !== undefined) {
+ dataOptions[key] = eData[attributeName];
+ }
+ });
+ return dataOptions;
+ },
+
+ place = function () {
+ var position = (component || element).position(),
+ offset = (component || element).offset(),
+ vertical = options.widgetPositioning.vertical,
+ horizontal = options.widgetPositioning.horizontal,
+ parent;
+
+ if (options.widgetParent) {
+ parent = options.widgetParent.append(widget);
+ } else if (element.is('input')) {
+ parent = element.parent().append(widget);
+ } else if (options.inline) {
+ parent = element.append(widget);
+ return;
+ } else {
+ parent = element;
+ element.children().first().after(widget);
+ }
+
+ // Top and bottom logic
+ if (vertical === 'auto') {
+ if (offset.top + widget.height() * 1.5 >= $(window).height() + $(window).scrollTop() &&
+ widget.height() + element.outerHeight() < offset.top) {
+ vertical = 'top';
+ } else {
+ vertical = 'bottom';
+ }
+ }
+
+ // Left and right logic
+ if (horizontal === 'auto') {
+ if (parent.width() < offset.left + widget.outerWidth() / 2 &&
+ offset.left + widget.outerWidth() > $(window).width()) {
+ horizontal = 'right';
+ } else {
+ horizontal = 'left';
+ }
+ }
+
+ if (vertical === 'top') {
+ widget.addClass('top').removeClass('bottom');
+ } else {
+ widget.addClass('bottom').removeClass('top');
+ }
+
+ if (horizontal === 'right') {
+ widget.addClass('pull-right');
+ } else {
+ widget.removeClass('pull-right');
+ }
+
+ // find the first parent element that has a relative css positioning
+ if (parent.css('position') !== 'relative') {
+ parent = parent.parents().filter(function () {
+ return $(this).css('position') === 'relative';
+ }).first();
+ }
+
+ if (parent.length === 0) {
+ throw new Error('datetimepicker component should be placed within a relative positioned container');
+ }
+
+ widget.css({
+ top: vertical === 'top' ? 'auto' : position.top + element.outerHeight(),
+ bottom: vertical === 'top' ? position.top + element.outerHeight() : 'auto',
+ left: horizontal === 'left' ? parent.css('padding-left') : 'auto',
+ right: horizontal === 'left' ? 'auto' : parent.width() - element.outerWidth()
+ });
+ },
+
+ notifyEvent = function (e) {
+ if (e.type === 'dp.change' && ((e.date && e.date.isSame(e.oldDate)) || (!e.date && !e.oldDate))) {
+ return;
+ }
+ element.trigger(e);
+ },
+
+ showMode = function (dir) {
+ if (!widget) {
+ return;
+ }
+ if (dir) {
+ currentViewMode = Math.max(minViewModeNumber, Math.min(2, currentViewMode + dir));
+ }
+ widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show();
+ },
+
+ fillDow = function () {
+ var row = $(''),
+ currentDate = viewDate.clone().startOf('w');
+
+ if (options.calendarWeeks === true) {
+ row.append($('| ').addClass('cw').text('#'));
+ }
+
+ while (currentDate.isBefore(viewDate.clone().endOf('w'))) {
+ row.append($(' | ').addClass('dow').text(currentDate.format('dd')));
+ currentDate.add(1, 'd');
+ }
+ widget.find('.datepicker-days thead').append(row);
+ },
+
+ isInDisabledDates = function (testDate) {
+ return options.disabledDates[testDate.format('YYYY-MM-DD')] === true;
+ },
+
+ isInEnabledDates = function (testDate) {
+ return options.enabledDates[testDate.format('YYYY-MM-DD')] === true;
+ },
+
+ isValid = function (targetMoment, granularity) {
+ if (!targetMoment.isValid()) {
+ return false;
+ }
+ if (options.disabledDates && isInDisabledDates(targetMoment) && granularity !== 'M') {
+ return false;
+ }
+ if (options.enabledDates && !isInEnabledDates(targetMoment) && granularity !== 'M') {
+ return false;
+ }
+ if (options.minDate && targetMoment.isBefore(options.minDate, granularity)) {
+ return false;
+ }
+ if (options.maxDate && targetMoment.isAfter(options.maxDate, granularity)) {
+ return false;
+ }
+ if (granularity === 'd' && options.daysOfWeekDisabled.indexOf(targetMoment.day()) !== -1) { //widget && widget.find('.datepicker-days').length > 0
+ return false;
+ }
+ return true;
+ },
+
+ fillMonths = function () {
+ var spans = [],
+ monthsShort = viewDate.clone().startOf('y').hour(12); // hour is changed to avoid DST issues in some browsers
+ while (monthsShort.isSame(viewDate, 'y')) {
+ spans.push($('').attr('data-action', 'selectMonth').addClass('month').text(monthsShort.format('MMM')));
+ monthsShort.add(1, 'M');
+ }
+ widget.find('.datepicker-months td').empty().append(spans);
+ },
+
+ updateMonths = function () {
+ var monthsView = widget.find('.datepicker-months'),
+ monthsViewHeader = monthsView.find('th'),
+ months = monthsView.find('tbody').find('span');
+
+ monthsView.find('.disabled').removeClass('disabled');
+
+ if (!isValid(viewDate.clone().subtract(1, 'y'), 'y')) {
+ monthsViewHeader.eq(0).addClass('disabled');
+ }
+
+ monthsViewHeader.eq(1).text(viewDate.year());
+
+ if (!isValid(viewDate.clone().add(1, 'y'), 'y')) {
+ monthsViewHeader.eq(2).addClass('disabled');
+ }
+
+ months.removeClass('active');
+ if (date.isSame(viewDate, 'y')) {
+ months.eq(date.month()).addClass('active');
+ }
+
+ months.each(function (index) {
+ if (!isValid(viewDate.clone().month(index), 'M')) {
+ $(this).addClass('disabled');
+ }
+ });
+ },
+
+ updateYears = function () {
+ var yearsView = widget.find('.datepicker-years'),
+ yearsViewHeader = yearsView.find('th'),
+ startYear = viewDate.clone().subtract(5, 'y'),
+ endYear = viewDate.clone().add(6, 'y'),
+ html = '';
+
+ yearsView.find('.disabled').removeClass('disabled');
+
+ if (options.minDate && options.minDate.isAfter(startYear, 'y')) {
+ yearsViewHeader.eq(0).addClass('disabled');
+ }
+
+ yearsViewHeader.eq(1).text(startYear.year() + '-' + endYear.year());
+
+ if (options.maxDate && options.maxDate.isBefore(endYear, 'y')) {
+ yearsViewHeader.eq(2).addClass('disabled');
+ }
+
+ while (!startYear.isAfter(endYear, 'y')) {
+ html += '' + startYear.year() + '';
+ startYear.add(1, 'y');
+ }
+
+ yearsView.find('td').html(html);
+ },
+
+ fillDate = function () {
+ var daysView = widget.find('.datepicker-days'),
+ daysViewHeader = daysView.find('th'),
+ currentDate,
+ html = [],
+ row,
+ clsName,
+ i;
+
+ if (!hasDate()) {
+ return;
+ }
+
+ daysView.find('.disabled').removeClass('disabled');
+ daysViewHeader.eq(1).text(viewDate.format(options.dayViewHeaderFormat));
+
+ if (!isValid(viewDate.clone().subtract(1, 'M'), 'M')) {
+ daysViewHeader.eq(0).addClass('disabled');
+ }
+ if (!isValid(viewDate.clone().add(1, 'M'), 'M')) {
+ daysViewHeader.eq(2).addClass('disabled');
+ }
+
+ currentDate = viewDate.clone().startOf('M').startOf('week');
+
+ // while (!viewDate.clone().endOf('M').endOf('w').isBefore(currentDate, 'd')) {
+ for (i = 0; i < 42; i++) { //always display 42 days (should show 6 weeks)
+ if (currentDate.weekday() === 0) {
+ row = $('');
+ if (options.calendarWeeks) {
+ row.append('| ' + currentDate.week() + ' | ');
+ }
+ html.push(row);
+ }
+ clsName = '';
+ if (currentDate.isBefore(viewDate, 'M')) {
+ clsName += ' old';
+ }
+ if (currentDate.isAfter(viewDate, 'M')) {
+ clsName += ' new';
+ }
+ if (currentDate.isSame(date, 'd') && !unset) {
+ clsName += ' active';
+ }
+ if (!isValid(currentDate, 'd')) {
+ clsName += ' disabled';
+ }
+ if (currentDate.isSame(moment(), 'd')) {
+ clsName += ' today';
+ }
+ if (currentDate.day() === 0 || currentDate.day() === 6) {
+ clsName += ' weekend';
+ }
+ row.append('' + currentDate.date() + ' | ');
+ currentDate.add(1, 'd');
+ }
+
+ daysView.find('tbody').empty().append(html);
+
+ updateMonths();
+
+ updateYears();
+ },
+
+ fillHours = function () {
+ var table = widget.find('.timepicker-hours table'),
+ currentHour = viewDate.clone().startOf('d'),
+ html = [],
+ row = $(' ');
+
+ if (viewDate.hour() > 11 && !use24Hours) {
+ currentHour.hour(12);
+ }
+ while (currentHour.isSame(viewDate, 'd') && (use24Hours || (viewDate.hour() < 12 && currentHour.hour() < 12) || viewDate.hour() > 11)) {
+ if (currentHour.hour() % 4 === 0) {
+ row = $(' ');
+ html.push(row);
+ }
+ row.append('| ' + currentHour.format(use24Hours ? 'HH' : 'hh') + ' | ');
+ currentHour.add(1, 'h');
+ }
+ table.empty().append(html);
+ },
+
+ fillMinutes = function () {
+ var table = widget.find('.timepicker-minutes table'),
+ currentMinute = viewDate.clone().startOf('h'),
+ html = [],
+ row = $(' '),
+ step = options.stepping === 1 ? 5 : options.stepping;
+
+ while (viewDate.isSame(currentMinute, 'h')) {
+ if (currentMinute.minute() % (step * 4) === 0) {
+ row = $(' ');
+ html.push(row);
+ }
+ row.append('| ' + currentMinute.format('mm') + ' | ');
+ currentMinute.add(step, 'm');
+ }
+ table.empty().append(html);
+ },
+
+ fillSeconds = function () {
+ var table = widget.find('.timepicker-seconds table'),
+ currentSecond = viewDate.clone().startOf('m'),
+ html = [],
+ row = $(' ');
+
+ while (viewDate.isSame(currentSecond, 'm')) {
+ if (currentSecond.second() % 20 === 0) {
+ row = $(' ');
+ html.push(row);
+ }
+ row.append('| ' + currentSecond.format('ss') + ' | ');
+ currentSecond.add(5, 's');
+ }
+
+ table.empty().append(html);
+ },
+
+ fillTime = function () {
+ var timeComponents = widget.find('.timepicker span[data-time-component]');
+ if (!use24Hours) {
+ widget.find('.timepicker [data-action=togglePeriod]').text(date.format('A'));
+ }
+ timeComponents.filter('[data-time-component=hours]').text(date.format(use24Hours ? 'HH' : 'hh'));
+ timeComponents.filter('[data-time-component=minutes]').text(date.format('mm'));
+ timeComponents.filter('[data-time-component=seconds]').text(date.format('ss'));
+
+ fillHours();
+ fillMinutes();
+ fillSeconds();
+ },
+
+ update = function () {
+ if (!widget) {
+ return;
+ }
+ fillDate();
+ fillTime();
+ },
+
+ setValue = function (targetMoment) {
+ var oldDate = unset ? null : date;
+
+ // case of calling setValue(null or false)
+ if (!targetMoment) {
+ unset = true;
+ input.val('');
+ element.data('date', '');
+ notifyEvent({
+ type: 'dp.change',
+ date: null,
+ oldDate: oldDate
+ });
+ update();
+ return;
+ }
+
+ targetMoment = targetMoment.clone().locale(options.locale);
+
+ if (options.stepping !== 1) {
+ targetMoment.minutes((Math.round(targetMoment.minutes() / options.stepping) * options.stepping) % 60).seconds(0);
+ }
+
+ if (isValid(targetMoment)) {
+ date = targetMoment;
+ viewDate = date.clone();
+ input.val(date.format(actualFormat));
+ element.data('date', date.format(actualFormat));
+ update();
+ unset = false;
+ notifyEvent({
+ type: 'dp.change',
+ date: date.clone(),
+ oldDate: oldDate
+ });
+ } else {
+ if (!options.keepInvalid) {
+ input.val(unset ? '' : date.format(actualFormat));
+ }
+ notifyEvent({
+ type: 'dp.error',
+ date: targetMoment
+ });
+ }
+ },
+
+ hide = function () {
+ var transitioning = false;
+ if (!widget) {
+ return picker;
+ }
+ // Ignore event if in the middle of a picker transition
+ widget.find('.collapse').each(function () {
+ var collapseData = $(this).data('collapse');
+ if (collapseData && collapseData.transitioning) {
+ transitioning = true;
+ return false;
+ }
+ return true;
+ });
+ if (transitioning) {
+ return picker;
+ }
+ if (component && component.hasClass('btn')) {
+ component.toggleClass('active');
+ }
+ widget.hide();
+
+ $(window).off('resize', place);
+ widget.off('click', '[data-action]');
+ widget.off('mousedown', false);
+
+ widget.remove();
+ widget = false;
+
+ notifyEvent({
+ type: 'dp.hide',
+ date: date.clone()
+ });
+ return picker;
+ },
+
+ clear = function () {
+ setValue(null);
+ },
+
+ /********************************************************************************
+ *
+ * Widget UI interaction functions
+ *
+ ********************************************************************************/
+ actions = {
+ next: function () {
+ viewDate.add(datePickerModes[currentViewMode].navStep, datePickerModes[currentViewMode].navFnc);
+ fillDate();
+ },
+
+ previous: function () {
+ viewDate.subtract(datePickerModes[currentViewMode].navStep, datePickerModes[currentViewMode].navFnc);
+ fillDate();
+ },
+
+ pickerSwitch: function () {
+ showMode(1);
+ },
+
+ selectMonth: function (e) {
+ var month = $(e.target).closest('tbody').find('span').index($(e.target));
+ viewDate.month(month);
+ if (currentViewMode === minViewModeNumber) {
+ setValue(date.clone().year(viewDate.year()).month(viewDate.month()));
+ if (!options.inline) {
+ hide();
+ }
+ } else {
+ showMode(-1);
+ fillDate();
+ }
+ },
+
+ selectYear: function (e) {
+ var year = parseInt($(e.target).text(), 10) || 0;
+ viewDate.year(year);
+ if (currentViewMode === minViewModeNumber) {
+ setValue(date.clone().year(viewDate.year()));
+ if (!options.inline) {
+ hide();
+ }
+ } else {
+ showMode(-1);
+ fillDate();
+ }
+ },
+
+ selectDay: function (e) {
+ var day = viewDate.clone();
+ if ($(e.target).is('.old')) {
+ day.subtract(1, 'M');
+ }
+ if ($(e.target).is('.new')) {
+ day.add(1, 'M');
+ }
+ setValue(day.date(parseInt($(e.target).text(), 10)));
+ if (!hasTime() && !options.keepOpen && !options.inline) {
+ hide();
+ }
+ },
+
+ incrementHours: function () {
+ setValue(date.clone().add(1, 'h'));
+ },
+
+ incrementMinutes: function () {
+ setValue(date.clone().add(options.stepping, 'm'));
+ },
+
+ incrementSeconds: function () {
+ setValue(date.clone().add(1, 's'));
+ },
+
+ decrementHours: function () {
+ setValue(date.clone().subtract(1, 'h'));
+ },
+
+ decrementMinutes: function () {
+ setValue(date.clone().subtract(options.stepping, 'm'));
+ },
+
+ decrementSeconds: function () {
+ setValue(date.clone().subtract(1, 's'));
+ },
+
+ togglePeriod: function () {
+ setValue(date.clone().add((date.hours() >= 12) ? -12 : 12, 'h'));
+ },
+
+ togglePicker: function (e) {
+ var $this = $(e.target),
+ $parent = $this.closest('ul'),
+ expanded = $parent.find('.in'),
+ closed = $parent.find('.collapse:not(.in)'),
+ collapseData;
+
+ if (expanded && expanded.length) {
+ collapseData = expanded.data('collapse');
+ if (collapseData && collapseData.transitioning) {
+ return;
+ }
+ if (expanded.collapse) { // if collapse plugin is available through bootstrap.js then use it
+ expanded.collapse('hide');
+ closed.collapse('show');
+ } else { // otherwise just toggle in class on the two views
+ expanded.removeClass('in');
+ closed.addClass('in');
+ }
+ if ($this.is('span')) {
+ $this.toggleClass(options.icons.time + ' ' + options.icons.date);
+ } else {
+ $this.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
+ }
+
+ // NOTE: uncomment if toggled state will be restored in show()
+ //if (component) {
+ // component.find('span').toggleClass(options.icons.time + ' ' + options.icons.date);
+ //}
+ }
+ },
+
+ showPicker: function () {
+ widget.find('.timepicker > div:not(.timepicker-picker)').hide();
+ widget.find('.timepicker .timepicker-picker').show();
+ },
+
+ showHours: function () {
+ widget.find('.timepicker .timepicker-picker').hide();
+ widget.find('.timepicker .timepicker-hours').show();
+ },
+
+ showMinutes: function () {
+ widget.find('.timepicker .timepicker-picker').hide();
+ widget.find('.timepicker .timepicker-minutes').show();
+ },
+
+ showSeconds: function () {
+ widget.find('.timepicker .timepicker-picker').hide();
+ widget.find('.timepicker .timepicker-seconds').show();
+ },
+
+ selectHour: function (e) {
+ var hour = parseInt($(e.target).text(), 10);
+
+ if (!use24Hours) {
+ if (date.hours() >= 12) {
+ if (hour !== 12) {
+ hour += 12;
+ }
+ } else {
+ if (hour === 12) {
+ hour = 0;
+ }
+ }
+ }
+ setValue(date.clone().hours(hour));
+ actions.showPicker.call(picker);
+ },
+
+ selectMinute: function (e) {
+ setValue(date.clone().minutes(parseInt($(e.target).text(), 10)));
+ actions.showPicker.call(picker);
+ },
+
+ selectSecond: function (e) {
+ setValue(date.clone().seconds(parseInt($(e.target).text(), 10)));
+ actions.showPicker.call(picker);
+ },
+
+ clear: clear,
+
+ today: function () {
+ setValue(moment());
+ },
+
+ close: hide
+ },
+
+ doAction = function (e) {
+ if ($(e.currentTarget).is('.disabled')) {
+ return false;
+ }
+ actions[$(e.currentTarget).data('action')].apply(picker, arguments);
+ return false;
+ },
+
+ show = function () {
+ var currentMoment,
+ useCurrentGranularity = {
+ 'year': function (m) {
+ return m.month(0).date(1).hours(0).seconds(0).minutes(0);
+ },
+ 'month': function (m) {
+ return m.date(1).hours(0).seconds(0).minutes(0);
+ },
+ 'day': function (m) {
+ return m.hours(0).seconds(0).minutes(0);
+ },
+ 'hour': function (m) {
+ return m.seconds(0).minutes(0);
+ },
+ 'minute': function (m) {
+ return m.seconds(0);
+ }
+ };
+
+ if (input.prop('disabled') || (!options.ignoreReadonly && input.prop('readonly')) || widget) {
+ return picker;
+ }
+ if (options.useCurrent && unset && ((input.is('input') && input.val().trim().length === 0) || options.inline)) {
+ currentMoment = moment();
+ if (typeof options.useCurrent === 'string') {
+ currentMoment = useCurrentGranularity[options.useCurrent](currentMoment);
+ }
+ setValue(currentMoment);
+ }
+
+ widget = getTemplate();
+
+ fillDow();
+ fillMonths();
+
+ widget.find('.timepicker-hours').hide();
+ widget.find('.timepicker-minutes').hide();
+ widget.find('.timepicker-seconds').hide();
+
+ update();
+ showMode();
+
+ $(window).on('resize', place);
+ widget.on('click', '[data-action]', doAction); // this handles clicks on the widget
+ widget.on('mousedown', false);
+
+ if (component && component.hasClass('btn')) {
+ component.toggleClass('active');
+ }
+ widget.show();
+ place();
+
+ if (!input.is(':focus')) {
+ input.focus();
+ }
+
+ notifyEvent({
+ type: 'dp.show'
+ });
+ return picker;
+ },
+
+ toggle = function () {
+ return (widget ? hide() : show());
+ },
+
+ parseInputDate = function (inputDate) {
+ if (moment.isMoment(inputDate) || inputDate instanceof Date) {
+ inputDate = moment(inputDate);
+ } else {
+ inputDate = moment(inputDate, parseFormats, options.useStrict);
+ }
+ inputDate.locale(options.locale);
+ return inputDate;
+ },
+
+ keydown = function (e) {
+ //if (e.keyCode === 27 && widget) { // allow escape to hide picker
+ // hide();
+ // return false;
+ //}
+ //if (e.keyCode === 40 && !widget) { // allow down to show picker
+ // show();
+ // e.preventDefault();
+ //}
+ //return true;
+
+ var handler = null,
+ index,
+ index2,
+ pressedKeys = [],
+ pressedModifiers = {},
+ currentKey = e.which,
+ keyBindKeys,
+ allModifiersPressed,
+ pressed = 'p';
+
+ keyState[currentKey] = pressed;
+
+ for (index in keyState) {
+ if (keyState.hasOwnProperty(index) && keyState[index] === pressed) {
+ pressedKeys.push(index);
+ if (parseInt(index, 10) !== currentKey) {
+ pressedModifiers[index] = true;
+ }
+ }
+ }
+
+ for (index in options.keyBinds) {
+ if (options.keyBinds.hasOwnProperty(index) && typeof (options.keyBinds[index]) === 'function') {
+ keyBindKeys = index.split(' ');
+ if (keyBindKeys.length === pressedKeys.length && keyMap[currentKey] === keyBindKeys[keyBindKeys.length - 1]) {
+ allModifiersPressed = true;
+ for (index2 = keyBindKeys.length - 2; index2 >= 0; index2--) {
+ if (!(keyMap[keyBindKeys[index2]] in pressedModifiers)) {
+ allModifiersPressed = false;
+ break;
+ }
+ }
+ if (allModifiersPressed) {
+ handler = options.keyBinds[index];
+ break;
+ }
+ }
+ }
+ }
+
+ if (handler) {
+ handler.call(picker, widget);
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ },
+
+ keyup = function (e) {
+ keyState[e.which] = 'r';
+ e.stopPropagation();
+ e.preventDefault();
+ },
+
+ change = function (e) {
+ var val = $(e.target).val().trim(),
+ parsedDate = val ? parseInputDate(val) : null;
+ setValue(parsedDate);
+ e.stopImmediatePropagation();
+ return false;
+ },
+
+ attachDatePickerElementEvents = function () {
+ input.on({
+ 'change': change,
+ 'blur': options.debug ? '' : hide,
+ 'keydown': keydown,
+ 'keyup': keyup
+ });
+
+ if (element.is('input')) {
+ input.on({
+ 'focus': show
+ });
+ } else if (component) {
+ component.on('click', toggle);
+ component.on('mousedown', false);
+ }
+ },
+
+ detachDatePickerElementEvents = function () {
+ input.off({
+ 'change': change,
+ 'blur': hide,
+ 'keydown': keydown,
+ 'keyup': keyup
+ });
+
+ if (element.is('input')) {
+ input.off({
+ 'focus': show
+ });
+ } else if (component) {
+ component.off('click', toggle);
+ component.off('mousedown', false);
+ }
+ },
+
+ indexGivenDates = function (givenDatesArray) {
+ // Store given enabledDates and disabledDates as keys.
+ // This way we can check their existence in O(1) time instead of looping through whole array.
+ // (for example: options.enabledDates['2014-02-27'] === true)
+ var givenDatesIndexed = {};
+ $.each(givenDatesArray, function () {
+ var dDate = parseInputDate(this);
+ if (dDate.isValid()) {
+ givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
+ }
+ });
+ return (Object.keys(givenDatesIndexed).length) ? givenDatesIndexed : false;
+ },
+
+ initFormatting = function () {
+ var format = options.format || 'L LT';
+
+ actualFormat = format.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput) {
+ var newinput = date.localeData().longDateFormat(formatInput) || formatInput;
+ return newinput.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (formatInput2) { //temp fix for #740
+ return date.localeData().longDateFormat(formatInput2) || formatInput2;
+ });
+ });
+
+
+ parseFormats = options.extraFormats ? options.extraFormats.slice() : [];
+ if (parseFormats.indexOf(format) < 0 && parseFormats.indexOf(actualFormat) < 0) {
+ parseFormats.push(actualFormat);
+ }
+
+ use24Hours = (actualFormat.toLowerCase().indexOf('a') < 1 && actualFormat.indexOf('h') < 1);
+
+ if (isEnabled('y')) {
+ minViewModeNumber = 2;
+ }
+ if (isEnabled('M')) {
+ minViewModeNumber = 1;
+ }
+ if (isEnabled('d')) {
+ minViewModeNumber = 0;
+ }
+
+ currentViewMode = Math.max(minViewModeNumber, currentViewMode);
+
+ if (!unset) {
+ setValue(date);
+ }
+ };
+
+ /********************************************************************************
+ *
+ * Public API functions
+ * =====================
+ *
+ * Important: Do not expose direct references to private objects or the options
+ * object to the outer world. Always return a clone when returning values or make
+ * a clone when setting a private variable.
+ *
+ ********************************************************************************/
+ picker.destroy = function () {
+ hide();
+ detachDatePickerElementEvents();
+ element.removeData('DateTimePicker');
+ element.removeData('date');
+ };
+
+ picker.toggle = toggle;
+
+ picker.show = show;
+
+ picker.hide = hide;
+
+ picker.disable = function () {
+ hide();
+ if (component && component.hasClass('btn')) {
+ component.addClass('disabled');
+ }
+ input.prop('disabled', true);
+ return picker;
+ };
+
+ picker.enable = function () {
+ if (component && component.hasClass('btn')) {
+ component.removeClass('disabled');
+ }
+ input.prop('disabled', false);
+ return picker;
+ };
+
+ picker.ignoreReadonly = function (ignoreReadonly) {
+ if (arguments.length === 0) {
+ return options.ignoreReadonly;
+ }
+ if (typeof ignoreReadonly !== 'boolean') {
+ throw new TypeError('ignoreReadonly () expects a boolean parameter');
+ }
+ options.ignoreReadonly = ignoreReadonly;
+ return picker;
+ };
+
+ picker.options = function (newOptions) {
+ if (arguments.length === 0) {
+ return $.extend(true, {}, options);
+ }
+
+ if (!(newOptions instanceof Object)) {
+ throw new TypeError('options() options parameter should be an object');
+ }
+ $.extend(true, options, newOptions);
+ $.each(options, function (key, value) {
+ if (picker[key] !== undefined) {
+ picker[key](value);
+ } else {
+ throw new TypeError('option ' + key + ' is not recognized!');
+ }
+ });
+ return picker;
+ };
+
+ picker.date = function (newDate) {
+ if (arguments.length === 0) {
+ if (unset) {
+ return null;
+ }
+ return date.clone();
+ }
+
+ if (newDate !== null && typeof newDate !== 'string' && !moment.isMoment(newDate) && !(newDate instanceof Date)) {
+ throw new TypeError('date() parameter must be one of [null, string, moment or Date]');
+ }
+
+ setValue(newDate === null ? null : parseInputDate(newDate));
+ return picker;
+ };
+
+ picker.format = function (newFormat) {
+ if (arguments.length === 0) {
+ return options.format;
+ }
+
+ if ((typeof newFormat !== 'string') && ((typeof newFormat !== 'boolean') || (newFormat !== false))) {
+ throw new TypeError('format() expects a sting or boolean:false parameter ' + newFormat);
+ }
+
+ options.format = newFormat;
+ if (actualFormat) {
+ initFormatting(); // reinit formatting
+ }
+ return picker;
+ };
+
+ picker.dayViewHeaderFormat = function (newFormat) {
+ if (arguments.length === 0) {
+ return options.dayViewHeaderFormat;
+ }
+
+ if (typeof newFormat !== 'string') {
+ throw new TypeError('dayViewHeaderFormat() expects a string parameter');
+ }
+
+ options.dayViewHeaderFormat = newFormat;
+ return picker;
+ };
+
+ picker.extraFormats = function (formats) {
+ if (arguments.length === 0) {
+ return options.extraFormats;
+ }
+
+ if (formats !== false && !(formats instanceof Array)) {
+ throw new TypeError('extraFormats() expects an array or false parameter');
+ }
+
+ options.extraFormats = formats;
+ if (parseFormats) {
+ initFormatting(); // reinit formatting
+ }
+ return picker;
+ };
+
+ picker.disabledDates = function (dates) {
+ if (arguments.length === 0) {
+ return (options.disabledDates ? $.extend({}, options.disabledDates) : options.disabledDates);
+ }
+
+ if (!dates) {
+ options.disabledDates = false;
+ update();
+ return picker;
+ }
+ if (!(dates instanceof Array)) {
+ throw new TypeError('disabledDates() expects an array parameter');
+ }
+ options.disabledDates = indexGivenDates(dates);
+ options.enabledDates = false;
+ update();
+ return picker;
+ };
+
+ picker.enabledDates = function (dates) {
+ if (arguments.length === 0) {
+ return (options.enabledDates ? $.extend({}, options.enabledDates) : options.enabledDates);
+ }
+
+ if (!dates) {
+ options.enabledDates = false;
+ update();
+ return picker;
+ }
+ if (!(dates instanceof Array)) {
+ throw new TypeError('enabledDates() expects an array parameter');
+ }
+ options.enabledDates = indexGivenDates(dates);
+ options.disabledDates = false;
+ update();
+ return picker;
+ };
+
+ picker.daysOfWeekDisabled = function (daysOfWeekDisabled) {
+ if (arguments.length === 0) {
+ return options.daysOfWeekDisabled.splice(0);
+ }
+
+ if (!(daysOfWeekDisabled instanceof Array)) {
+ throw new TypeError('daysOfWeekDisabled() expects an array parameter');
+ }
+ options.daysOfWeekDisabled = daysOfWeekDisabled.reduce(function (previousValue, currentValue) {
+ currentValue = parseInt(currentValue, 10);
+ if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) {
+ return previousValue;
+ }
+ if (previousValue.indexOf(currentValue) === -1) {
+ previousValue.push(currentValue);
+ }
+ return previousValue;
+ }, []).sort();
+ update();
+ return picker;
+ };
+
+ picker.maxDate = function (maxDate) {
+ if (arguments.length === 0) {
+ return options.maxDate ? options.maxDate.clone() : options.maxDate;
+ }
+
+ if ((typeof maxDate === 'boolean') && maxDate === false) {
+ options.maxDate = false;
+ update();
+ return picker;
+ }
+
+ if (typeof maxDate === 'string') {
+ if (maxDate === 'now' || maxDate === 'moment') {
+ maxDate = moment();
+ }
+ }
+
+ var parsedDate = parseInputDate(maxDate);
+
+ if (!parsedDate.isValid()) {
+ throw new TypeError('maxDate() Could not parse date parameter: ' + maxDate);
+ }
+ if (options.minDate && parsedDate.isBefore(options.minDate)) {
+ throw new TypeError('maxDate() date parameter is before options.minDate: ' + parsedDate.format(actualFormat));
+ }
+ options.maxDate = parsedDate;
+ if (options.maxDate.isBefore(maxDate)) {
+ setValue(options.maxDate);
+ }
+ if (viewDate.isAfter(parsedDate)) {
+ viewDate = parsedDate.clone();
+ }
+ update();
+ return picker;
+ };
+
+ picker.minDate = function (minDate) {
+ if (arguments.length === 0) {
+ return options.minDate ? options.minDate.clone() : options.minDate;
+ }
+
+ if ((typeof minDate === 'boolean') && minDate === false) {
+ options.minDate = false;
+ update();
+ return picker;
+ }
+
+ if (typeof minDate === 'string') {
+ if (minDate === 'now' || minDate === 'moment') {
+ minDate = moment();
+ }
+ }
+
+ var parsedDate = parseInputDate(minDate);
+
+ if (!parsedDate.isValid()) {
+ throw new TypeError('minDate() Could not parse date parameter: ' + minDate);
+ }
+ if (options.maxDate && parsedDate.isAfter(options.maxDate)) {
+ throw new TypeError('minDate() date parameter is after options.maxDate: ' + parsedDate.format(actualFormat));
+ }
+ options.minDate = parsedDate;
+ if (options.minDate.isAfter(minDate)) {
+ setValue(options.minDate);
+ }
+ if (viewDate.isBefore(parsedDate)) {
+ viewDate = parsedDate.clone();
+ }
+ update();
+ return picker;
+ };
+
+ picker.defaultDate = function (defaultDate) {
+ if (arguments.length === 0) {
+ return options.defaultDate ? options.defaultDate.clone() : options.defaultDate;
+ }
+ if (!defaultDate) {
+ options.defaultDate = false;
+ return picker;
+ }
+
+ if (typeof defaultDate === 'string') {
+ if (defaultDate === 'now' || defaultDate === 'moment') {
+ defaultDate = moment();
+ }
+ }
+
+ var parsedDate = parseInputDate(defaultDate);
+ if (!parsedDate.isValid()) {
+ throw new TypeError('defaultDate() Could not parse date parameter: ' + defaultDate);
+ }
+ if (!isValid(parsedDate)) {
+ throw new TypeError('defaultDate() date passed is invalid according to component setup validations');
+ }
+
+ options.defaultDate = parsedDate;
+
+ if (options.defaultDate && input.val().trim() === '' && input.attr('placeholder') === undefined) {
+ setValue(options.defaultDate);
+ }
+ return picker;
+ };
+
+ picker.locale = function (locale) {
+ if (arguments.length === 0) {
+ return options.locale;
+ }
+
+ if (!moment.localeData(locale)) {
+ throw new TypeError('locale() locale ' + locale + ' is not loaded from moment locales!');
+ }
+
+ options.locale = locale;
+ date.locale(options.locale);
+ viewDate.locale(options.locale);
+
+ if (actualFormat) {
+ initFormatting(); // reinit formatting
+ }
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.stepping = function (stepping) {
+ if (arguments.length === 0) {
+ return options.stepping;
+ }
+
+ stepping = parseInt(stepping, 10);
+ if (isNaN(stepping) || stepping < 1) {
+ stepping = 1;
+ }
+ options.stepping = stepping;
+ return picker;
+ };
+
+ picker.useCurrent = function (useCurrent) {
+ var useCurrentOptions = ['year', 'month', 'day', 'hour', 'minute'];
+ if (arguments.length === 0) {
+ return options.useCurrent;
+ }
+
+ if ((typeof useCurrent !== 'boolean') && (typeof useCurrent !== 'string')) {
+ throw new TypeError('useCurrent() expects a boolean or string parameter');
+ }
+ if (typeof useCurrent === 'string' && useCurrentOptions.indexOf(useCurrent.toLowerCase()) === -1) {
+ throw new TypeError('useCurrent() expects a string parameter of ' + useCurrentOptions.join(', '));
+ }
+ options.useCurrent = useCurrent;
+ return picker;
+ };
+
+ picker.collapse = function (collapse) {
+ if (arguments.length === 0) {
+ return options.collapse;
+ }
+
+ if (typeof collapse !== 'boolean') {
+ throw new TypeError('collapse() expects a boolean parameter');
+ }
+ if (options.collapse === collapse) {
+ return picker;
+ }
+ options.collapse = collapse;
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.icons = function (icons) {
+ if (arguments.length === 0) {
+ return $.extend({}, options.icons);
+ }
+
+ if (!(icons instanceof Object)) {
+ throw new TypeError('icons() expects parameter to be an Object');
+ }
+ $.extend(options.icons, icons);
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.useStrict = function (useStrict) {
+ if (arguments.length === 0) {
+ return options.useStrict;
+ }
+
+ if (typeof useStrict !== 'boolean') {
+ throw new TypeError('useStrict() expects a boolean parameter');
+ }
+ options.useStrict = useStrict;
+ return picker;
+ };
+
+ picker.sideBySide = function (sideBySide) {
+ if (arguments.length === 0) {
+ return options.sideBySide;
+ }
+
+ if (typeof sideBySide !== 'boolean') {
+ throw new TypeError('sideBySide() expects a boolean parameter');
+ }
+ options.sideBySide = sideBySide;
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.viewMode = function (viewMode) {
+ if (arguments.length === 0) {
+ return options.viewMode;
+ }
+
+ if (typeof viewMode !== 'string') {
+ throw new TypeError('viewMode() expects a string parameter');
+ }
+
+ if (viewModes.indexOf(viewMode) === -1) {
+ throw new TypeError('viewMode() parameter must be one of (' + viewModes.join(', ') + ') value');
+ }
+
+ options.viewMode = viewMode;
+ currentViewMode = Math.max(viewModes.indexOf(viewMode), minViewModeNumber);
+
+ showMode();
+ return picker;
+ };
+
+ picker.toolbarPlacement = function (toolbarPlacement) {
+ if (arguments.length === 0) {
+ return options.toolbarPlacement;
+ }
+
+ if (typeof toolbarPlacement !== 'string') {
+ throw new TypeError('toolbarPlacement() expects a string parameter');
+ }
+ if (toolbarPlacements.indexOf(toolbarPlacement) === -1) {
+ throw new TypeError('toolbarPlacement() parameter must be one of (' + toolbarPlacements.join(', ') + ') value');
+ }
+ options.toolbarPlacement = toolbarPlacement;
+
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.widgetPositioning = function (widgetPositioning) {
+ if (arguments.length === 0) {
+ return $.extend({}, options.widgetPositioning);
+ }
+
+ if (({}).toString.call(widgetPositioning) !== '[object Object]') {
+ throw new TypeError('widgetPositioning() expects an object variable');
+ }
+ if (widgetPositioning.horizontal) {
+ if (typeof widgetPositioning.horizontal !== 'string') {
+ throw new TypeError('widgetPositioning() horizontal variable must be a string');
+ }
+ widgetPositioning.horizontal = widgetPositioning.horizontal.toLowerCase();
+ if (horizontalModes.indexOf(widgetPositioning.horizontal) === -1) {
+ throw new TypeError('widgetPositioning() expects horizontal parameter to be one of (' + horizontalModes.join(', ') + ')');
+ }
+ options.widgetPositioning.horizontal = widgetPositioning.horizontal;
+ }
+ if (widgetPositioning.vertical) {
+ if (typeof widgetPositioning.vertical !== 'string') {
+ throw new TypeError('widgetPositioning() vertical variable must be a string');
+ }
+ widgetPositioning.vertical = widgetPositioning.vertical.toLowerCase();
+ if (verticalModes.indexOf(widgetPositioning.vertical) === -1) {
+ throw new TypeError('widgetPositioning() expects vertical parameter to be one of (' + verticalModes.join(', ') + ')');
+ }
+ options.widgetPositioning.vertical = widgetPositioning.vertical;
+ }
+ update();
+ return picker;
+ };
+
+ picker.calendarWeeks = function (calendarWeeks) {
+ if (arguments.length === 0) {
+ return options.calendarWeeks;
+ }
+
+ if (typeof calendarWeeks !== 'boolean') {
+ throw new TypeError('calendarWeeks() expects parameter to be a boolean value');
+ }
+
+ options.calendarWeeks = calendarWeeks;
+ update();
+ return picker;
+ };
+
+ picker.showTodayButton = function (showTodayButton) {
+ if (arguments.length === 0) {
+ return options.showTodayButton;
+ }
+
+ if (typeof showTodayButton !== 'boolean') {
+ throw new TypeError('showTodayButton() expects a boolean parameter');
+ }
+
+ options.showTodayButton = showTodayButton;
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.showClear = function (showClear) {
+ if (arguments.length === 0) {
+ return options.showClear;
+ }
+
+ if (typeof showClear !== 'boolean') {
+ throw new TypeError('showClear() expects a boolean parameter');
+ }
+
+ options.showClear = showClear;
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.widgetParent = function (widgetParent) {
+ if (arguments.length === 0) {
+ return options.widgetParent;
+ }
+
+ if (typeof widgetParent === 'string') {
+ widgetParent = $(widgetParent);
+ }
+
+ if (widgetParent !== null && (typeof widgetParent !== 'string' && !(widgetParent instanceof $))) {
+ throw new TypeError('widgetParent() expects a string or a jQuery object parameter');
+ }
+
+ options.widgetParent = widgetParent;
+ if (widget) {
+ hide();
+ show();
+ }
+ return picker;
+ };
+
+ picker.keepOpen = function (keepOpen) {
+ if (arguments.length === 0) {
+ return options.keepOpen;
+ }
+
+ if (typeof keepOpen !== 'boolean') {
+ throw new TypeError('keepOpen() expects a boolean parameter');
+ }
+
+ options.keepOpen = keepOpen;
+ return picker;
+ };
+
+ picker.inline = function (inline) {
+ if (arguments.length === 0) {
+ return options.inline;
+ }
+
+ if (typeof inline !== 'boolean') {
+ throw new TypeError('inline() expects a boolean parameter');
+ }
+
+ options.inline = inline;
+ return picker;
+ };
+
+ picker.clear = function () {
+ clear();
+ return picker;
+ };
+
+ picker.keyBinds = function (keyBinds) {
+ options.keyBinds = keyBinds;
+ return picker;
+ };
+
+ picker.debug = function (debug) {
+ if (typeof debug !== 'boolean') {
+ throw new TypeError('debug() expects a boolean parameter');
+ }
+
+ options.debug = debug;
+ return picker;
+ };
+
+ picker.showClose = function (showClose) {
+ if (arguments.length === 0) {
+ return options.showClose;
+ }
+
+ if (typeof showClose !== 'boolean') {
+ throw new TypeError('showClose() expects a boolean parameter');
+ }
+
+ options.showClose = showClose;
+ return picker;
+ };
+
+ picker.keepInvalid = function (keepInvalid) {
+ if (arguments.length === 0) {
+ return options.keepInvalid;
+ }
+
+ if (typeof keepInvalid !== 'boolean') {
+ throw new TypeError('keepInvalid() expects a boolean parameter');
+ }
+ options.keepInvalid = keepInvalid;
+ return picker;
+ };
+
+ picker.datepickerInput = function (datepickerInput) {
+ if (arguments.length === 0) {
+ return options.datepickerInput;
+ }
+
+ if (typeof datepickerInput !== 'string') {
+ throw new TypeError('datepickerInput() expects a string parameter');
+ }
+
+ options.datepickerInput = datepickerInput;
+ return picker;
+ };
+
+ // initializing element and component attributes
+ if (element.is('input')) {
+ input = element;
+ } else {
+ input = element.find(options.datepickerInput);
+ if (input.size() === 0) {
+ input = element.find('input');
+ } else if (!input.is('input')) {
+ throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
+ }
+ }
+
+ if (element.hasClass('input-group')) {
+ // in case there is more then one 'input-group-addon' Issue #48
+ if (element.find('.datepickerbutton').size() === 0) {
+ component = element.find('[class^="input-group-"]');
+ } else {
+ component = element.find('.datepickerbutton');
+ }
+ }
+
+ if (!options.inline && !input.is('input')) {
+ throw new Error('Could not initialize DateTimePicker without an input element');
+ }
+
+ $.extend(true, options, dataToOptions());
+
+ picker.options(options);
+
+ initFormatting();
+
+ attachDatePickerElementEvents();
+
+ if (input.prop('disabled')) {
+ picker.disable();
+ }
+ if (input.is('input') && input.val().trim().length !== 0) {
+ setValue(parseInputDate(input.val().trim()));
+ }
+ else if (options.defaultDate && input.attr('placeholder') === undefined) {
+ setValue(options.defaultDate);
+ }
+ if (options.inline) {
+ show();
+ }
+ return picker;
+ };
+
+ /********************************************************************************
+ *
+ * jQuery plugin constructor and defaults object
+ *
+ ********************************************************************************/
+
+ $.fn.datetimepicker = function (options) {
+ return this.each(function () {
+ var $this = $(this);
+ if (!$this.data('DateTimePicker')) {
+ // create a private copy of the defaults object
+ options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
+ $this.data('DateTimePicker', dateTimePicker($this, options));
+ }
+ });
+ };
+
+ $.fn.datetimepicker.defaults = {
+ format: false,
+ dayViewHeaderFormat: 'MMMM YYYY',
+ extraFormats: false,
+ stepping: 1,
+ minDate: false,
+ maxDate: false,
+ useCurrent: true,
+ collapse: true,
+ locale: moment.locale(),
+ defaultDate: false,
+ disabledDates: false,
+ enabledDates: false,
+ icons: {
+ time: 'glyphicon glyphicon-time',
+ date: 'glyphicon glyphicon-calendar',
+ up: 'glyphicon glyphicon-chevron-up',
+ down: 'glyphicon glyphicon-chevron-down',
+ previous: 'glyphicon glyphicon-chevron-left',
+ next: 'glyphicon glyphicon-chevron-right',
+ today: 'glyphicon glyphicon-screenshot',
+ clear: 'glyphicon glyphicon-trash',
+ close: 'glyphicon glyphicon-remove'
+ },
+ useStrict: false,
+ sideBySide: false,
+ daysOfWeekDisabled: [],
+ calendarWeeks: false,
+ viewMode: 'days',
+ toolbarPlacement: 'default',
+ showTodayButton: false,
+ showClear: false,
+ showClose: false,
+ widgetPositioning: {
+ horizontal: 'auto',
+ vertical: 'auto'
+ },
+ widgetParent: null,
+ ignoreReadonly: false,
+ keepOpen: false,
+ inline: false,
+ keepInvalid: false,
+ datepickerInput: '.datepickerinput',
+ keyBinds: {
+ up: function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().subtract(7, 'd'));
+ } else {
+ this.date(d.clone().add(1, 'm'));
+ }
+ },
+ down: function (widget) {
+ if (!widget) {
+ this.show();
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().add(7, 'd'));
+ } else {
+ this.date(d.clone().subtract(1, 'm'));
+ }
+ },
+ 'control up': function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().subtract(1, 'y'));
+ } else {
+ this.date(d.clone().add(1, 'h'));
+ }
+ },
+ 'control down': function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().add(1, 'y'));
+ } else {
+ this.date(d.clone().subtract(1, 'h'));
+ }
+ },
+ left: function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().subtract(1, 'd'));
+ }
+ },
+ right: function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().add(1, 'd'));
+ }
+ },
+ pageUp: function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().subtract(1, 'M'));
+ }
+ },
+ pageDown: function (widget) {
+ if (!widget) {
+ return;
+ }
+ var d = this.date() || moment();
+ if (widget.find('.datepicker').is(':visible')) {
+ this.date(d.clone().add(1, 'M'));
+ }
+ },
+ enter: function () {
+ this.hide();
+ },
+ escape: function () {
+ this.hide();
+ },
+ //tab: function (widget) { //this break the flow of the form. disabling for now
+ // var toggle = widget.find('.picker-switch a[data-action="togglePicker"]');
+ // if(toggle.length > 0) toggle.click();
+ //},
+ 'control space': function (widget) {
+ if (widget.find('.timepicker').is(':visible')) {
+ widget.find('.btn[data-action="togglePeriod"]').click();
+ }
+ },
+ t: function () {
+ this.date(moment());
+ },
+ 'delete': function () {
+ this.clear();
+ }
+ },
+ debug: false
+ };
+}));
diff --git a/vendor/assets/javascripts/pickers.js b/vendor/assets/javascripts/pickers.js
new file mode 100644
index 00000000..63c9a7ba
--- /dev/null
+++ b/vendor/assets/javascripts/pickers.js
@@ -0,0 +1,42 @@
+$(document).on('ready page:change', function() {
+ $('.datetimepicker').datetimepicker({
+ // put here your custom picker options, that should be applied for all pickers
+ icons: {
+ date: 'fa fa-calendar',
+ time: 'fa fa-clock-o',
+ up: 'fa fa-chevron-up',
+ down: 'fa fa-chevron-down',
+ previous: 'fa fa-chevron-left',
+ next: 'fa fa-chevron-right',
+ today: 'fa fa-crosshairs',
+ clear: 'fa fa-trash-o',
+ close: 'fa fa-times'
+ }
+ });
+
+ $('.datetimerange').each(function(){
+ var $this = $(this)
+ var range1 = $($this.find('.input-group')[0])
+ var range2 = $($this.find('.input-group')[1])
+
+ if(range1.data("DateTimePicker").date() != null)
+ range2.data("DateTimePicker").minDate(range1.data("DateTimePicker").date());
+
+ if(range2.data("DateTimePicker").date() != null)
+ range1.data("DateTimePicker").maxDate(range2.data("DateTimePicker").date());
+
+ range1.on("dp.change",function (e) {
+ if(e.date)
+ range2.data("DateTimePicker").minDate(e.date);
+ else
+ range2.data("DateTimePicker").minDate(false);
+ });
+
+ range2.on("dp.change",function (e) {
+ if(e.date)
+ range1.data("DateTimePicker").maxDate(e.date);
+ else
+ range1.data("DateTimePicker").maxDate(false);
+ });
+ })
+});
diff --git a/vendor/assets/stylesheets/bootstrap-datetimepicker.css b/vendor/assets/stylesheets/bootstrap-datetimepicker.css
new file mode 100644
index 00000000..c7021619
--- /dev/null
+++ b/vendor/assets/stylesheets/bootstrap-datetimepicker.css
@@ -0,0 +1,366 @@
+/*!
+ * Datetimepicker for Bootstrap 3
+ * ! version : 4.7.14
+ * https://github.com/Eonasdan/bootstrap-datetimepicker/
+ */
+.bootstrap-datetimepicker-widget {
+ list-style: none;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu {
+ margin: 2px 0;
+ padding: 4px;
+ width: 19em;
+}
+@media (min-width: 768px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 992px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 1200px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+.bootstrap-datetimepicker-widget.dropdown-menu:before,
+.bootstrap-datetimepicker-widget.dropdown-menu:after {
+ content: '';
+ display: inline-block;
+ position: absolute;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-bottom: 7px solid #cccccc;
+ border-bottom-color: rgba(0, 0, 0, 0.2);
+ top: -7px;
+ left: 7px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-bottom: 6px solid white;
+ top: -6px;
+ left: 8px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-top: 7px solid #cccccc;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ bottom: -7px;
+ left: 6px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-top: 6px solid white;
+ bottom: -6px;
+ left: 7px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
+ left: auto;
+ right: 6px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
+ left: auto;
+ right: 7px;
+}
+.bootstrap-datetimepicker-widget .list-unstyled {
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget a[data-action] {
+ padding: 6px 0;
+}
+.bootstrap-datetimepicker-widget a[data-action]:active {
+ box-shadow: none;
+}
+.bootstrap-datetimepicker-widget .timepicker-hour,
+.bootstrap-datetimepicker-widget .timepicker-minute,
+.bootstrap-datetimepicker-widget .timepicker-second {
+ width: 54px;
+ font-weight: bold;
+ font-size: 1.2em;
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget button[data-action] {
+ padding: 6px;
+}
+.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle AM/PM";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Clear the picker";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Set the date to today";
+}
+.bootstrap-datetimepicker-widget .picker-switch {
+ text-align: center;
+}
+.bootstrap-datetimepicker-widget .picker-switch::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle Date and Time Screens";
+}
+.bootstrap-datetimepicker-widget .picker-switch td {
+ padding: 0;
+ margin: 0;
+ height: auto;
+ width: auto;
+ line-height: inherit;
+}
+.bootstrap-datetimepicker-widget .picker-switch td span {
+ line-height: 2.5;
+ height: 2.5em;
+ width: 100%;
+}
+.bootstrap-datetimepicker-widget table {
+ width: 100%;
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget table td,
+.bootstrap-datetimepicker-widget table th {
+ text-align: center;
+ border-radius: 4px;
+}
+.bootstrap-datetimepicker-widget table th {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+.bootstrap-datetimepicker-widget table th.picker-switch {
+ width: 145px;
+}
+.bootstrap-datetimepicker-widget table th.disabled,
+.bootstrap-datetimepicker-widget table th.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget table th.prev::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Previous Month";
+}
+.bootstrap-datetimepicker-widget table th.next::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Next Month";
+}
+.bootstrap-datetimepicker-widget table thead tr:first-child th {
+ cursor: pointer;
+}
+.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
+ background: #eeeeee;
+}
+.bootstrap-datetimepicker-widget table td {
+ height: 54px;
+ line-height: 54px;
+ width: 54px;
+}
+.bootstrap-datetimepicker-widget table td.cw {
+ font-size: .8em;
+ height: 20px;
+ line-height: 20px;
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td.day {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+.bootstrap-datetimepicker-widget table td.day:hover,
+.bootstrap-datetimepicker-widget table td.hour:hover,
+.bootstrap-datetimepicker-widget table td.minute:hover,
+.bootstrap-datetimepicker-widget table td.second:hover {
+ background: #eeeeee;
+ cursor: pointer;
+}
+.bootstrap-datetimepicker-widget table td.old,
+.bootstrap-datetimepicker-widget table td.new {
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td.today {
+ position: relative;
+}
+.bootstrap-datetimepicker-widget table td.today:before {
+ content: '';
+ display: inline-block;
+ border: 0 0 7px 7px solid transparent;
+ border-bottom-color: #337ab7;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ position: absolute;
+ bottom: 4px;
+ right: 4px;
+}
+.bootstrap-datetimepicker-widget table td.active,
+.bootstrap-datetimepicker-widget table td.active:hover {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.bootstrap-datetimepicker-widget table td.active.today:before {
+ border-bottom-color: #fff;
+}
+.bootstrap-datetimepicker-widget table td.disabled,
+.bootstrap-datetimepicker-widget table td.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget table td span {
+ display: inline-block;
+ width: 54px;
+ height: 54px;
+ line-height: 54px;
+ margin: 2px 1.5px;
+ cursor: pointer;
+ border-radius: 4px;
+}
+.bootstrap-datetimepicker-widget table td span:hover {
+ background: #eeeeee;
+}
+.bootstrap-datetimepicker-widget table td span.active {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.bootstrap-datetimepicker-widget table td span.old {
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td span.disabled,
+.bootstrap-datetimepicker-widget table td span.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
+ height: 27px;
+ line-height: 27px;
+}
+.input-group.date .input-group-addon {
+ cursor: pointer;
+}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
diff --git a/vendor/assets/stylesheets/bootstrap-datetimepicker.min.css b/vendor/assets/stylesheets/bootstrap-datetimepicker.min.css
new file mode 100644
index 00000000..c7021619
--- /dev/null
+++ b/vendor/assets/stylesheets/bootstrap-datetimepicker.min.css
@@ -0,0 +1,366 @@
+/*!
+ * Datetimepicker for Bootstrap 3
+ * ! version : 4.7.14
+ * https://github.com/Eonasdan/bootstrap-datetimepicker/
+ */
+.bootstrap-datetimepicker-widget {
+ list-style: none;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu {
+ margin: 2px 0;
+ padding: 4px;
+ width: 19em;
+}
+@media (min-width: 768px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 992px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 1200px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+.bootstrap-datetimepicker-widget.dropdown-menu:before,
+.bootstrap-datetimepicker-widget.dropdown-menu:after {
+ content: '';
+ display: inline-block;
+ position: absolute;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-bottom: 7px solid #cccccc;
+ border-bottom-color: rgba(0, 0, 0, 0.2);
+ top: -7px;
+ left: 7px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-bottom: 6px solid white;
+ top: -6px;
+ left: 8px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-top: 7px solid #cccccc;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ bottom: -7px;
+ left: 6px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-top: 6px solid white;
+ bottom: -6px;
+ left: 7px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
+ left: auto;
+ right: 6px;
+}
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
+ left: auto;
+ right: 7px;
+}
+.bootstrap-datetimepicker-widget .list-unstyled {
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget a[data-action] {
+ padding: 6px 0;
+}
+.bootstrap-datetimepicker-widget a[data-action]:active {
+ box-shadow: none;
+}
+.bootstrap-datetimepicker-widget .timepicker-hour,
+.bootstrap-datetimepicker-widget .timepicker-minute,
+.bootstrap-datetimepicker-widget .timepicker-second {
+ width: 54px;
+ font-weight: bold;
+ font-size: 1.2em;
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget button[data-action] {
+ padding: 6px;
+}
+.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Hours";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Minutes";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle AM/PM";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Clear the picker";
+}
+.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Set the date to today";
+}
+.bootstrap-datetimepicker-widget .picker-switch {
+ text-align: center;
+}
+.bootstrap-datetimepicker-widget .picker-switch::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle Date and Time Screens";
+}
+.bootstrap-datetimepicker-widget .picker-switch td {
+ padding: 0;
+ margin: 0;
+ height: auto;
+ width: auto;
+ line-height: inherit;
+}
+.bootstrap-datetimepicker-widget .picker-switch td span {
+ line-height: 2.5;
+ height: 2.5em;
+ width: 100%;
+}
+.bootstrap-datetimepicker-widget table {
+ width: 100%;
+ margin: 0;
+}
+.bootstrap-datetimepicker-widget table td,
+.bootstrap-datetimepicker-widget table th {
+ text-align: center;
+ border-radius: 4px;
+}
+.bootstrap-datetimepicker-widget table th {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+.bootstrap-datetimepicker-widget table th.picker-switch {
+ width: 145px;
+}
+.bootstrap-datetimepicker-widget table th.disabled,
+.bootstrap-datetimepicker-widget table th.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget table th.prev::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Previous Month";
+}
+.bootstrap-datetimepicker-widget table th.next::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Next Month";
+}
+.bootstrap-datetimepicker-widget table thead tr:first-child th {
+ cursor: pointer;
+}
+.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
+ background: #eeeeee;
+}
+.bootstrap-datetimepicker-widget table td {
+ height: 54px;
+ line-height: 54px;
+ width: 54px;
+}
+.bootstrap-datetimepicker-widget table td.cw {
+ font-size: .8em;
+ height: 20px;
+ line-height: 20px;
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td.day {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+.bootstrap-datetimepicker-widget table td.day:hover,
+.bootstrap-datetimepicker-widget table td.hour:hover,
+.bootstrap-datetimepicker-widget table td.minute:hover,
+.bootstrap-datetimepicker-widget table td.second:hover {
+ background: #eeeeee;
+ cursor: pointer;
+}
+.bootstrap-datetimepicker-widget table td.old,
+.bootstrap-datetimepicker-widget table td.new {
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td.today {
+ position: relative;
+}
+.bootstrap-datetimepicker-widget table td.today:before {
+ content: '';
+ display: inline-block;
+ border: 0 0 7px 7px solid transparent;
+ border-bottom-color: #337ab7;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ position: absolute;
+ bottom: 4px;
+ right: 4px;
+}
+.bootstrap-datetimepicker-widget table td.active,
+.bootstrap-datetimepicker-widget table td.active:hover {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.bootstrap-datetimepicker-widget table td.active.today:before {
+ border-bottom-color: #fff;
+}
+.bootstrap-datetimepicker-widget table td.disabled,
+.bootstrap-datetimepicker-widget table td.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget table td span {
+ display: inline-block;
+ width: 54px;
+ height: 54px;
+ line-height: 54px;
+ margin: 2px 1.5px;
+ cursor: pointer;
+ border-radius: 4px;
+}
+.bootstrap-datetimepicker-widget table td span:hover {
+ background: #eeeeee;
+}
+.bootstrap-datetimepicker-widget table td span.active {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+.bootstrap-datetimepicker-widget table td span.old {
+ color: #777777;
+}
+.bootstrap-datetimepicker-widget table td span.disabled,
+.bootstrap-datetimepicker-widget table td span.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
+ height: 27px;
+ line-height: 27px;
+}
+.input-group.date .input-group-addon {
+ cursor: pointer;
+}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
|