Handles day focus from the embedded day Picker.
This function assumes there is a "datesRow" aggregation.
So callers must take care.
@return {void}
@private
967272
function _handleDateFocus(oEvent){

		var oFocusedDate = new UniversalDate(this._getFocusedDate().getTime());
		var oDate = CalendarUtils._createUniversalUTCDate(oEvent.getParameter("date"), undefined, true);
		var bNotVisible = oEvent.getParameter("otherMonth");

		if (bNotVisible &&
				oDate.getUTCMonth() == oFocusedDate.getUTCMonth() &&
				oDate.getUTCFullYear() == oFocusedDate.getUTCFullYear()) {
			// only show days in the same month
			// set start date and focus date
			_setDateInDatesRow.call(this, oDate);
		}

	}
1162913
function() {
			var self = this;
			if (self.isDisabled) return;
	
			self.ignoreFocus = true;
			self.$control_input[0].focus();
			window.setTimeout(function() {
				self.ignoreFocus = false;
				self.onFocus();
			}, 0);
		}
230035
function (evt) {
            // when clicking on a date in the calendar, close the calendar, and save the date
            var date = evt.date;
            this._closeDropdown();

            var report = this.controller.checkValue(date);
            this._reactToControllerReport(report);
        }
344536
function () {
            // By default, keepFocus is false, unless it is set to true later:
            this._keepFocus = false;
            if (this._dropdownPopup) {
                var calendarFocus = this._calendarFocus;

                if (this._hasFocus && !calendarFocus) {
                    // passing the focus from the text field to the icon
                    this._keepFocus = true;
                }
                // override the focus method so that calling focus on the DatePicker while it is open
                // actually focuses the dropdown icon
                // focusing the DatePicker while the popup is open means focusing the dropdown icon
                if (!calendarFocus) {
                    this.controller.getCalendar().focus();
                }
            } else {
                if (this._hasFocus && this._calendarFocus) {
                    // passing the focus from the icon to the text field
                    this._keepFocus = true;
                }
                // do the normal action otherwise:
                this.$DropDownTextInput.focus.apply(this, arguments);
            }
        }
1224732
function _setDateInDatesRow(oDate) {

		var oDatesRow = this.getAggregation("datesRow");
		var oHeader = this.getAggregation("header");

		if (!this.getPickerPopup()) {
			// set number of days - but max number of days of this month
			var oLastDayOfMonth = new UniversalDate(oDate.getTime());
			oLastDayOfMonth.setUTCDate(1);
			oLastDayOfMonth.setUTCMonth(oLastDayOfMonth.getUTCMonth() + 1);
			oLastDayOfMonth.setUTCDate(0);
			var iDays = oDatesRow.getDays();

			// set start day and selected day
			var oStartDate = new UniversalDate(oDate.getTime());
			oStartDate.setUTCDate( 1 + (Math.ceil(oDate.getUTCDate() / iDays) - 1) * iDays );
			if (oLastDayOfMonth.getUTCDate() - oStartDate.getUTCDate() < iDays) {
				oStartDate.setUTCDate(oLastDayOfMonth.getUTCDate() - iDays + 1);
			}

			oDatesRow.setStartDate(CalendarUtils._createLocalDate(oStartDate, true));

			var iYear = oStartDate.getJSDate().getUTCFullYear();
			var iYearMax = this._oMaxDate.getJSDate().getUTCFullYear();
			var iYearMin = this._oMinDate.getJSDate().getUTCFullYear();
			var iMonth = oStartDate.getJSDate().getUTCMonth();
			var iMonthMax = this._oMaxDate.getJSDate().getUTCMonth();
			var iMonthMin = this._oMinDate.getJSDate().getUTCMonth();
			var iDate = oStartDate.getJSDate().getUTCDate();
			var iDateMax = this._oMaxDate.getJSDate().getUTCDate();
			var iDateMin = this._oMinDate.getJSDate().getUTCDate();

			if (iDate <= 1 || (iYear == iYearMin && iMonth == iMonthMin && iDate <= iDateMin)) {
				oHeader.setEnabledPrevious(false);
			} else {
				oHeader.setEnabledPrevious(true);
			}

			if ((iDate + iDays) >= oLastDayOfMonth.getUTCDate() || (iYear == iYearMax && iMonth == iMonthMax && iDate >= iDateMax)) {
				oHeader.setEnabledNext(false);
			} else {
				oHeader.setEnabledNext(true);
			}
		} else {
			oHeader.setEnabledPrevious(false);
			oHeader.setEnabledNext(false);
		}

		oDatesRow.setDate(CalendarUtils._createLocalDate(oDate, true));
	}
152354
function(target, date) {
		var inst = this._getInst(target);
		if (inst) {
			this._setDate(inst, date);
			this._updateDatepicker(inst);
			this._updateAlternate(inst);
		}
	}
30546
protected void processCalendarData(ProjectCalendar calendar, Row row)
   {
      int dayIndex = row.getInt("CD_DAY_OR_EXCEPTION");
      if (dayIndex == 0)
      {
         processCalendarException(calendar, row);
      }
      else
      {
         processCalendarHours(calendar, row, dayIndex);
      }
   }
640213
protected void dispatchOnRangeSelected(@NonNull final List<CalendarDay> days) {
    if (rangeListener != null) {
      rangeListener.onRangeSelected(MaterialCalendarView.this, days);
    }
  }
1371090
protected void dispatchOnDateSelected(final CalendarDay day, final boolean selected) {
    if (listener != null) {
      listener.onDateSelected(MaterialCalendarView.this, day, selected);
    }
  }
325767
function(inst) {
		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
		instActive = inst; // for delegate hover events
		inst.dpDiv.empty().append(this._generateHTML(inst));
		this._attachHandlers(inst);
		inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();

		var origyearshtml,
			numMonths = this._getNumberOfMonths(inst),
			cols = numMonths[1],
			width = 17;

		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
		if (cols > 1) {
			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
		}
		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
			"Class"]("ui-datepicker-multi");
		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
			"Class"]("ui-datepicker-rtl");

		// #6694 - don't focus the input if it's already focused
		// this breaks the change event in IE
		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
			inst.input.is(":visible") && !inst.input.is(":disabled") && inst.input[0] !== document.activeElement) {
			inst.input.focus();
		}

		// deffered render of the years select (to avoid flashes on Firefox)
		if( inst.yearshtml ){
			origyearshtml = inst.yearshtml;
			setTimeout(function(){
				//assure that inst.yearshtml didn't change.
				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
				}
				origyearshtml = inst.yearshtml = null;
			}, 0);
		}
	}
896061
function( theEvent ) {
        var target,
            targetElement = theEvent.target,
            ui = this._ui;

        if ( !this._isOpen ) {
            return;
        }

        if ( targetElement !== ui.container[ 0 ] ) {
            target = $( targetElement );
            if ( !$.contains( ui.container[ 0 ], targetElement ) ) {
                $( this.document[ 0 ].activeElement ).one( "focus", $.proxy( function() {
                    this._safelyBlur( targetElement );
                }, this ) );
                ui.focusElement.focus();
                theEvent.preventDefault();
                theEvent.stopImmediatePropagation();
                return false;
            } else if ( ui.focusElement[ 0 ] === ui.container[ 0 ] ) {
                ui.focusElement = target;
            }
        }

        this._ignoreResizeEvents();
    }
462213
function _showDayPicker(){

		if (this._iMode == 3) {
			_hideYearPicker.call(this, true);
		}else if (this._iMode == 2) {
			_hideMonthPicker.call(this, true);
		}

		var oDate = this._getFocusedDate();
		var iItems = this._getItems();
		var oDatesRow = this.getAggregation("datesRow");
		var oDateRange = oDatesRow.getSelectedDates()[0];
		oDateRange.setStartDate(CalendarUtils._createLocalDate(oDate, true));

		// set number of days - but max number of days of this month
		var oLastDayOfMonth = new UniversalDate(oDate.getTime());
		oLastDayOfMonth.setUTCDate(1);
		oLastDayOfMonth.setUTCMonth(oLastDayOfMonth.getUTCMonth() + 1);
		oLastDayOfMonth.setUTCDate(0);
		var iLastDay = oLastDayOfMonth.getUTCDate();
		var iDays = Math.floor(iItems * 1.5);
		if (iDays > iLastDay) {
			// to be limited on real month length by opening
			iDays = iLastDay;
		}
		oDatesRow.setDays(iDays);

		if (oDatesRow.getDomRef()) {
			// already rendered
			oDatesRow.$().css("display", "");
		} else {
			var oRm = sap.ui.getCore().createRenderManager();
			var $Container = this.$("content");
			oRm.renderControl(oDatesRow);
			oRm.flush($Container[0], false, true); // insert it
			oRm.destroy();
		}

		this._showOverlay();

		// set start date and focus date
		_setDateInDatesRow.call(this, oDate);

		if (this._iMode == 0) {
			// remove tabindex from item
			var oTimesRow = this.getAggregation("timesRow");

			jQuery(oTimesRow._oItemNavigation.getItemDomRefs()[oTimesRow._oItemNavigation.getFocusedIndex()]).attr("tabindex", "-1");
		}

		this._iMode = 1;

	}
1049567
function hideCalendar() {
            if (this.calendar !== undefined && this.calendar !== null) {
                var calendar = this.getCalendar();
                if (calendar.parent !== null) {
                    calendar.removeMe();
                    if (this.calendarHidden !== undefined) {
                        this.calendarHidden();
                    }
                    this.$anchor.requestFocus();
                    this.$anchor = null;
                }
            }
            return this;
        }
177090
function(e) {
	
      var date = this.getValue(true);
      if (!!this.calendar) {
         
			if(!!date) {
         	// HACK: don't fire Field updatedEvt when selecting date
         	this.ignoreBeforeShowOverlayCall = true;
         	// select the previous date in calendar
        		this.calendar.select(date);
				this.ignoreBeforeShowOverlayCall = false;
         	this.calendar.cfg.setProperty("pagedate",(date.getMonth()+1)+"/"+date.getFullYear());
			}

         this.calendar.render(); // refresh calendar
      }
   }
99700
function(){
      // dates
      var now = new Date();

      this.selectedDate = new Value({ value: new Date(this.date || now) });
      this.date = new Value({ value: new Date(this.date || now) });

      // insert sections
      this.isPeriodEnabled = this.isPeriodEnabled.bind(this);

      // inherit
      Node.prototype.init.call(this);

      if (this.sections)
      {
        // deprecated in 1.3.0
        /** @cut */ basis.dev.warn('basis.ui.calendar.Calendar#sections is deprecated, use childNodes instead');
        this.setChildNodes(this.sections);
      }
    }
654425
function addcalendarExtenderToDateInputs () {
  //get and loop all the input[type=date]s in the page that dont have "haveCal" class yet
  var dateInputs = document.querySelectorAll('input[type=date]:not(.haveCal)');
  [].forEach.call(dateInputs, function (dateInput) {
    //call calendarExtender function on the input
    new calendarExtender(dateInput);
    //mark that it have calendar
    dateInput.classList.add('haveCal');
  });
}
1206668
function defaultSelectionEnd(startDate, allDay) {
		if (allDay) {
			return cloneDate(startDate);
		}
		return addMinutes(cloneDate(startDate), opt('slotMinutes'));
	}