Clicked somewhere in the calendar.
972715
def _pressed(self, evt):
        
        x, y, widget = evt.x, evt.y, evt.widget
        item = widget.identify_row(y)
        column = widget.identify_column(x)

        if not column or not (item in self._items):
            # clicked in the weekdays row or just outside the columns
            return

        item_values = widget.item(item)['values']
        if not len(item_values):  # row is empty for this month
            return

        text = item_values[int(column[1]) - 1]
        if not text:  # date is empty
            return

        bbox = widget.bbox(item, column)
        if not bbox:  # calendar not visible yet
            return

        # update and then show selection
        text = '%02d' % text
        self._selection = (text, item, column)
        self._show_selection(text, bbox)

        if self.callback is not None:
            self.callback()
133750
public void goToDate(Calendar date) {
        mScroller.forceFinished(true);
        mCurrentScrollDirection = mCurrentFlingDirection = Direction.NONE;

        date.set(Calendar.HOUR_OF_DAY, 0);
        date.set(Calendar.MINUTE, 0);
        date.set(Calendar.SECOND, 0);
        date.set(Calendar.MILLISECOND, 0);

        if(mAreDimensionsInvalid) {
            mScrollToDay = date;
            return;
        }

        mRefreshEvents = true;

        Calendar today = Calendar.getInstance();
        today.set(Calendar.HOUR_OF_DAY, 0);
        today.set(Calendar.MINUTE, 0);
        today.set(Calendar.SECOND, 0);
        today.set(Calendar.MILLISECOND, 0);

        long day = 1000L * 60L * 60L * 24L;
        long dateInMillis = date.getTimeInMillis() + date.getTimeZone().getOffset(date.getTimeInMillis());
        long todayInMillis = today.getTimeInMillis() + today.getTimeZone().getOffset(today.getTimeInMillis());
        long dateDifference = (dateInMillis/day) - (todayInMillis/day);
        mCurrentOrigin.x = - dateDifference * (mWidthPerDay + mColumnGap);
        invalidate();
    }
496315
private void dateLabelMousePressed(MouseEvent e) {
        // Get the label that was clicked.
        JLabel label = (JLabel) e.getSource();
        // If the label is empty, do nothing and return.
        String labelText = label.getText();
        if ("".equals(labelText)) {
            return;
        }
        // We have a label with a specific date, so set the date and close the calendar.
        int dayOfMonth = Integer.parseInt(labelText);
        LocalDate clickedDate = LocalDate.of(
            displayedYearMonth.getYear(), displayedYearMonth.getMonth(), dayOfMonth);
        userSelectedADate(clickedDate);
    }
911223
def _next_month(self):
        """"""
        self._canvas.place_forget()

        year, month = self._date.year, self._date.month
        self._date = self._date + self.timedelta(
            days=calendar.monthrange(year, month)[1] + 1)
        self._date = self.datetime(self._date.year, self._date.month, 1)
        self._build_calendar()
518836
function onShow(superOnShow) {
  superOnShow();
  
	changeCalendar.call(this, "en", calendarTypes.GREGORIAN, sample, 2);
  
  this.calendar.setSelectedDate({"month":11,"year":2017,"day":1});
	var fn = this.calendar.nextMonth.bind(this.calendar);
	
	// runner.add(fn, "nextMonth");
	// runner.add(fn, "nextMonth2");
	// runner.add(fn, "nextMonth3");
	// runner.add(fn, "nextMonth4");
	// runner.add(fn, "nextMonth5");
	// runner.add(fn, "nextMonth6");
	// runner.add(fn, "nextMonth7");
	// runner.add(fn, "nextMonth8");
	// runner.add(fn, "nextMonth9");
	// runner.add(fn, "nextMonth10");
	
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth5");
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth6");
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth7");
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth8");
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth9");
	// runner.add(this.calendar.nextMonth.bind(this.calendar), "nextMonth10");
	
	// runner.add(this.calendar.prevMonth.bind(this.calendar), "prevMonth");
	// runner.add(this.calendar.prevMonth.bind(this.calendar), "prevMonth2");
	// runner.add(this.calendar.prevMonth.bind(this.calendar), "prevMonth3");

	// setTimeout(function(){
		runner.runAll(3, function(res){
			res.forEach(function(item, index){
				// console.log(index+":"+item.logs.length);
				console.log(index+":"+item.asString);
				// item.logs.forEach(function(log){
				// });
			});
		});
		
	// }
	// , 3)
  // alert(JSON.stringify(benchmark()))
  // console.log(benchmark());
}
677526
private static int dayToUtilDay(int day) {
        switch (day) {
            case EventRecurrence.SU: return Calendar.SUNDAY;
            case EventRecurrence.MO: return Calendar.MONDAY;
            case EventRecurrence.TU: return Calendar.TUESDAY;
            case EventRecurrence.WE: return Calendar.WEDNESDAY;
            case EventRecurrence.TH: return Calendar.THURSDAY;
            case EventRecurrence.FR: return Calendar.FRIDAY;
            case EventRecurrence.SA: return Calendar.SATURDAY;
            default: throw new IllegalArgumentException("bad day argument: " + day);
        }
    }
530406
function (property, targetCfg) {
            var cfg = this._cfg, skinObj = this._skinObj;
            var calendarProp = 'calendar' + property.substring(0, 1).toUpperCase() + property.substring(1);
            targetCfg[property] = (typeof cfg[calendarProp] != 'undefined')
                    ? cfg[calendarProp]
                    : skinObj.calendar[property];
        }
1311936
private void getMonthlyRelativeDates(Calendar calendar, int frequency, List<Date> dates)
   {
      long startDate = calendar.getTimeInMillis();
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      int dayNumber = NumberHelper.getInt(m_dayNumber);

      while (moreDates(calendar, dates))
      {
         if (dayNumber > 4)
         {
            setCalendarToLastRelativeDay(calendar);
         }
         else
         {
            setCalendarToOrdinalRelativeDay(calendar, dayNumber);
         }

         if (calendar.getTimeInMillis() > startDate)
         {
            dates.add(calendar.getTime());
            if (!moreDates(calendar, dates))
            {
               break;
            }
         }
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         calendar.add(Calendar.MONTH, frequency);
      }
   }
1135118
void selectDay(int year, int month, int day) {
        Calendar cal = Calendar.getInstance();
        cal.set(year, month, day);
        Date date = cal.getTime();
        this.field.setText(simpleDateFormat.format(date));
        if (popup != null) {
            popup.hide();
            popup = null;
        }
    }
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
      }
   }
993254
private String getKeyForCalendarEvent(Calendar cal) {
        return cal.get(Calendar.YEAR) + "_" + cal.get(Calendar.MONTH);
    }
1026748
function(date)
        {
            if (!isDate(date)) {
                return;
            }
            this._y = date.getFullYear();
            this._m = date.getMonth();
            this.draw();
        }
1167876
private void updateCalendarVisibility() {
		CalendarView view = getSkinnable();

		if (view.getSelectedPage() == view.getDayPage()) {
			view.getDayPage().refreshData();
		} else if (view.getSelectedPage() == view.getWeekPage()) {
			view.getWeekPage().refreshData();
		}
	}
375672
public void addCalendar (final String calName,
                           final ICalendar calendar,
                           final boolean replace,
                           final boolean updateTriggers) throws SchedulerException
  {
    m_aSched.addCalendar (calName, calendar, replace, updateTriggers);
  }
421063
function (el) {
            var date = el.data('date') || 1,
                month = el.data('month') || 0,
                year = el.data('year') || this.d.parsedDate.year,
                dp = this.d;
            // Change view if min view does not reach yet
            if (dp.view != this.opts.minView) {
                dp.down(new Date(year, month, date));
                return;
            }
            // Select date if min view is reached
            var selectedDate = new Date(year, month, date),
                alreadySelected = this.d._isSelected(selectedDate, this.d.cellType);

            if (!alreadySelected) {
                dp._trigger('clickCell', selectedDate);
                return;
            }

            dp._handleAlreadySelectedDates.bind(dp, alreadySelected, selectedDate)();

        }
1144485
private static Calendar toCalendar(Date self) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(self);
        return cal;
    }
146674
@UiHandler("m_everyDay")
    void onEveryDayChange(ValueChangeEvent<String> event) {

        if (handleChange()) {
            m_controller.setInterval(m_everyDay.getFormValueAsString());
        }

    }