Select the right date and display the right page on calendar, when the field has a value
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
      }
   }
1069540
def fill_in_textfield(self, field_name, value):
    

    date_field = find_any_field(world.browser,
                                DATE_FIELDS,
                                field_name)
    if date_field:
        field = date_field
    else:
        field = find_any_field(world.browser,
                               TEXT_FIELDS,
                               field_name)

    if not field:
        raise AssertionError(
            "Cannot find a field named '{}'.".format(field_name))

    if date_field:
        field.send_keys(Keys.DELETE)
    else:
        field.clear()

    field.send_keys(value)
779234
public static int getBeginValue(Calendar calendar, int dateField) {
		if(Calendar.DAY_OF_WEEK == dateField) {
			return calendar.getFirstDayOfWeek();
		}
		return calendar.getActualMinimum(dateField);
	}
281123
def day_view(request, year, month, day, template='swingtime/daily_view.html', **params):
    '''
    

    '''
    dt = datetime(int(year), int(month), int(day))
    return _datetime_view(request, template, dt, **params)
268326
@Override
    public void setValue(Object value) {
        if (value != null) {
            Calendar c = (Calendar) value;
            ((JTextField) editor).setText(DEFAULT_DATE_FORMAT.format(c.getTime()));
        }
    }
992566
public int setCalendar(Calendar value, boolean bDisplayOption, int moveMode)
    {           // Set this field's value
        if (value != null)
        {
            value.set(Calendar.HOUR_OF_DAY, 0);
            value.set(Calendar.MINUTE, 0);
            value.set(Calendar.SECOND, 0);
            value.set(Calendar.MILLISECOND, 0);
        }
        return super.setCalendar(value, bDisplayOption, moveMode);
    }
1202444
public function date($name, $value = null, $min = null, $max = null, $options = array())
    {
        if( !isset($min) && !isset($max) ) return 'The date field "'.$name.'" must have a min, max or both.';
        
        if( isset($min) ) $options['min'] = $min;
        if( isset($max) ) $options['max'] = $max;
        
		return $this->input('date', $name, $value, $options);
    }
1084956
function calendarComponent() {
    $this->objName         = ( isset( $this->timezonetype )) ?
                          strtolower( $this->timezonetype )  :  get_class ( $this );
    $this->uid             = array();
    $this->dtstamp         = array();

    $this->action          = array();
    $this->attach          = array();
    $this->attendee        = array();
    $this->categories      = array();
    $this->class           = array();
    $this->comment         = array();
    $this->completed       = array();
    $this->contact         = array();
    $this->created         = array();
    $this->description     = array();
    $this->dtend           = array();
    $this->dtstart         = array();
    $this->due             = array();
    $this->duration        = array();
    $this->exdate          = array();
    $this->exrule          = array();
    $this->freebusy        = array();
    $this->geo             = array();
    $this->lastmodified    = array();
    $this->location        = array();
    $this->organizer       = array();
    $this->percentcomplete = array();
    $this->priority        = array();
    $this->rdate           = array();
    $this->recurrenceid    = array();
    $this->relatedto       = array();
    $this->repeat          = array();
    $this->requeststatus   = array();
    $this->resources       = array();
    $this->sequence        = array();
    $this->rrule           = array();
    $this->status          = array();
    $this->summary         = array();
    $this->transp          = array();
    $this->trigger         = array();
    $this->tzid            = array();
    $this->tzname          = array();
    $this->tzoffsetfrom    = array();
    $this->tzoffsetto      = array();
    $this->tzurl           = array();
    $this->url             = array();
    $this->xprop           = array();

    $this->components      = array();

    $this->language        = null;
    $this->nl              = null;
    $this->unique_id       = null;
    $this->allowEmpty      = TRUE;
    $this->xcaldecl        = array();

    $this->_makeDtstamp();
  }
655118
public function &date_display()
    {

        $text = "";
        $this->range_start = $this->range_end = "";
        $this->range_start = $this->column_value;

        if (!array_key_exists("clearform", $_REQUEST) && array_key_exists("MANUAL_" . $this->query_name . "_FROMDATE", $_REQUEST)) {
            $this->range_start = $_REQUEST["MANUAL_" . $this->query_name . "_FROMDATE"];
            $this->range_start = $this->collateRequestDate($this->query_name, "FROMDATE", $this->range_start, ReporticoApp::getConfig("prep_dateformat"));
        } else
        if (!array_key_exists("clearform", $_REQUEST) && array_key_exists("HIDDEN_" . $this->query_name . "_FROMDATE", $_REQUEST)) {
            $this->range_start = $_REQUEST["HIDDEN_" . $this->query_name . "_FROMDATE"];
            $this->range_start = $this->collateRequestDate($this->query_name, "FROMDATE", $this->range_start, ReporticoApp::getConfig("prep_dateformat"));
        } else {
            if (count($this->defaults) == 0) {
                $this->defaults[0] = "TODAY";
            }
            if ($this->defaults[0]) {
                $dummy = "";
                if (!ReporticoLocale::convertDateRangeDefaultsToDates("DATE", $this->defaults[0], $this->range_start, $dummy)) {
                    trigger_error("Date default '" . $this->defaults[0] . "' is not a valid date. Should be in date format (e.g. yyyy-mm-dd, dd/mm/yyyy) or a date type (TODAY, TOMMORROW etc", E_USER_ERROR);
                }

            }
            unset($_REQUEST["HIDDEN_" . $this->query_name . "_FROMDATE"]);
            unset($_REQUEST["HIDDEN_" . $this->query_name . "_TODATE"]);
        }

        $this->range_start = ReporticoLocale::parseDate($this->range_start, false, ReporticoApp::getConfig("prep_dateformat"));
        $text .= $this->formatDateValue($this->query_name . '_FROMDATE', $this->range_start, ReporticoApp::getConfig("prep_dateformat"));

        return $text;

    }
1342064
function(date, preventOnSelect)
        {
            if (!date) {
                this._d = null;
                return this.draw();
            }
            if (typeof date === 'string') {
                date = new Date(Date.parse(date));
            }
            if (!isDate(date)) {
                return;
            }

            var min = this._o.minDate,
                max = this._o.maxDate;

            if (isDate(min) && date < min) {
                date = min;
            } else if (isDate(max) && date > max) {
                date = max;
            }

            this._d = new Date(date.getTime());
            setToStartOfDay(this._d);
            this.gotoDate(this._d);

            if (this._o.field) {
                this._o.field.value = this.toString();
                fireEvent(this._o.field, 'change', { firedBy: this });
            }
            if (!preventOnSelect && typeof this._o.onSelect === 'function') {
                this._o.onSelect.call(this, this.getDate());
            }
        }
1326685
protected void onDateClicked(final DayView dayView) {
    final CalendarDay currentDate = getCurrentDate();
    final CalendarDay selectedDate = dayView.getDate();
    final int currentMonth = currentDate.getMonth();
    final int selectedMonth = selectedDate.getMonth();

    if (calendarMode == CalendarMode.MONTHS
        && allowClickDaysOutsideCurrentMonth
        && currentMonth != selectedMonth) {
      if (currentDate.isAfter(selectedDate)) {
        goToPrevious();
      } else if (currentDate.isBefore(selectedDate)) {
        goToNext();
      }
    }
    onDateClicked(dayView.getDate(), !dayView.isChecked());
  }
852777
public static int getEndValue(Calendar calendar, int dateField) {
		if(Calendar.DAY_OF_WEEK == dateField) {
			return (calendar.getFirstDayOfWeek() + 6) % 7;
		}
		return calendar.getActualMaximum(dateField);
	}
29096
public void setDate(int index, Date value)
   {
      set(selectField(TaskFieldLists.CUSTOM_DATE, index), value);
   }
46531
function (noop, date) {
            var _field = $(this.options.AltField);
            if (_field.length) {
                _field.val( this._formatMonth(date, this.options.AltFormat) );
            }
        }
1076667
function (event) {
      switch (attribute.type) {
        case 'Date':
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null) {
            var mm = attribute.value.getMonth() + 1;
            var dd = attribute.value.getDate();
            var yyyy = attribute.value.getFullYear();
            if (mm < 10) mm = '0' + mm;
            if (dd < 10) dd = '0' + dd;
            input.value = mm + '/' + dd + '/' + yyyy;
          } else {
            input.value = '';
          }
          break;
        default:
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null)
            input.value = attribute.value;
          break;
      }
      attribute.validate(function () {
      });
    }
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());
}
545741
private void populateCalendar(Record record, ProjectCalendar calendar, boolean isBaseCalendar)
   {
      if (isBaseCalendar == true)
      {
         calendar.setName(record.getString(0));
      }
      else
      {
         calendar.setParent(m_projectFile.getCalendarByName(record.getString(0)));
      }

      calendar.setWorkingDay(Day.SUNDAY, DayType.getInstance(record.getInteger(1)));
      calendar.setWorkingDay(Day.MONDAY, DayType.getInstance(record.getInteger(2)));
      calendar.setWorkingDay(Day.TUESDAY, DayType.getInstance(record.getInteger(3)));
      calendar.setWorkingDay(Day.WEDNESDAY, DayType.getInstance(record.getInteger(4)));
      calendar.setWorkingDay(Day.THURSDAY, DayType.getInstance(record.getInteger(5)));
      calendar.setWorkingDay(Day.FRIDAY, DayType.getInstance(record.getInteger(6)));
      calendar.setWorkingDay(Day.SATURDAY, DayType.getInstance(record.getInteger(7)));

      m_eventManager.fireCalendarReadEvent(calendar);
   }