UpdateCalendar Method.
421292
public void updateCalendar(Calendar calStart, Calendar calEnd)
    {
        Anniversary recAnniversary = new Anniversary(this.getRecordOwner());
        AnnivMaster recAnnivMaster = new AnnivMaster(this.getRecordOwner());
        recAnniversary.setKeyArea(Anniversary.START_DATE_TIME_KEY);
        try {
            while (recAnniversary.hasNext())
            {
                recAnniversary.next();
                if (recAnniversary.getField(Anniversary.START_DATE_TIME).compareTo(this.getField(CalendarControl.START_ANNIV_DATE)) > 0)
                    break;  // end of the entries that are not in the current range.
                recAnniversary.edit();
                recAnniversary.remove();
            }
            
            while (recAnnivMaster.hasNext())
            {
                recAnnivMaster.next();
                recAnnivMaster.addAppointments(recAnniversary, calStart, calEnd);
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        } finally {
            recAnniversary.free();
            recAnnivMaster.free();
        }
    }
1121156
public static void setCalendarData(Calendar calendar, Locale locale)
    {
        int[] array = (int[])localeData.get(locale);
        if(array == null)
        {
            Calendar c = Calendar.getInstance(locale);
            array = new int[2];
            array[0] = c.getFirstDayOfWeek();
            array[1] = c.getMinimalDaysInFirstWeek();
            localeData.putIfAbsent(locale, array);
        }
        calendar.setFirstDayOfWeek(array[0]);
        calendar.setMinimalDaysInFirstWeek(array[1]);
    }
758461
public void update(Date lastScheduledExecutionTime, Date lastActualExecutionTime, Date lastCompletionTime) {
        this.lastScheduledExecutionTime = lastScheduledExecutionTime;
        this.lastActualExecutionTime = lastActualExecutionTime;
        this.lastCompletionTime = lastCompletionTime;
    }
956808
protected void setCalendarHour(Calendar cal, int hour) {
    cal.set(Calendar.HOUR_OF_DAY, hour);
    if (cal.get(Calendar.HOUR_OF_DAY) != hour && hour != 24) {
      cal.set(Calendar.HOUR_OF_DAY, hour + 1);
    }
  }
293499
function(elem) {
			var inst = this._getInst(elem);
			if (!$.isEmptyObject(inst)) {
				inst.selectedDates = [];
				this.hide(elem);
				var defaultDate = inst.get('defaultDate');
				if (inst.options.selectDefaultDate && defaultDate) {
					this.setDate(elem, (defaultDate || inst.options.calendar.today()).newDate());
				}
				else {
					this._updateInput(elem);
				}
			}
		}
191435
public Calendar adjustDate(final Calendar startDate, final int increment, final NonWorkingDayChecker<Calendar> checker) {
        final Calendar cal = (Calendar) startDate.clone();

        while (checker.isNonWorkingDay(cal)) {
            cal.add(Calendar.DAY_OF_MONTH, increment);
        }

        return cal;
    }
58484
protected void processCalendar(Row row)
   {
      Integer uniqueID = row.getInteger("CAL_UID");
      if (NumberHelper.getInt(uniqueID) > 0)
      {
         boolean baseCalendar = row.getBoolean("CAL_IS_BASE_CAL");
         ProjectCalendar cal;
         if (baseCalendar == true)
         {
            cal = m_project.addCalendar();
            cal.setName(row.getString("CAL_NAME"));
         }
         else
         {
            Integer resourceID = row.getInteger("RES_UID");
            cal = m_project.addCalendar();
            m_baseCalendarReferences.add(new Pair<ProjectCalendar, Integer>(cal, row.getInteger("CAL_BASE_UID")));
            m_resourceMap.put(resourceID, cal);
         }

         cal.setUniqueID(uniqueID);
         m_calendarMap.put(uniqueID, cal);
         m_eventManager.fireCalendarReadEvent(cal);
      }
   }
1144485
private static Calendar toCalendar(Date self) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(self);
        return cal;
    }
269889
public void setTheDate()
    {
        boolean[] rgbEnabled = m_field.setEnableListeners(false);
        Calendar calAfter = m_field.getCalendar();
        Calendar calBefore = m_field.getCalendar();
        m_field.setValue(DateTimeField.currentTime(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);   // File written or updated, set the update date
        calAfter = m_field.getCalendar();
        if (calBefore != null)
            if (calAfter.before(calBefore))
                calAfter = calBefore;   // If this was set with a different computer (clock), make sure it always increases!
        if (calAfter != null)
            if (calAfter.equals(calBefore))
        {
            calAfter.add(Calendar.SECOND, 1);   // Can't be the same as last time.
            m_field.setCalendar(calAfter, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
        }
        Utility.getLogger().info("Set date: " + m_field.toString());
        m_field.setEnableListeners(rgbEnabled);
    }
135514
private void setCalendarToLastRelativeDay(Calendar calendar)
   {
      calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
      int currentDayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
      int requiredDayOfWeek = getDayOfWeek().getValue();
      int dayOfWeekOffset = 0;

      if (currentDayOfWeek > requiredDayOfWeek)
      {
         dayOfWeekOffset = requiredDayOfWeek - currentDayOfWeek;
      }
      else
      {
         if (currentDayOfWeek < requiredDayOfWeek)
         {
            dayOfWeekOffset = -7 + (requiredDayOfWeek - currentDayOfWeek);
         }
      }

      if (dayOfWeekOffset != 0)
      {
         calendar.add(Calendar.DAY_OF_YEAR, dayOfWeekOffset);
      }
   }
130773
protected void onDayTapped(CalendarDay day) {
        mController.tryVibrate();
        mController.onDayOfMonthSelected(day.year, day.month, day.day);
        setSelectedDay(day);
    }
488516
def update(self):
        

        if not self.calendar_id:
            return False

        url = self.build_url(self._endpoints.get('calendar'))

        data = {
            self._cc('name'): self.name,
            self._cc('color'): self._cc(self.color.value
                                        if isinstance(self.color, CalendarColor)
                                        else self.color)
        }

        response = self.con.patch(url, data=data)

        return bool(response)
565142
def OnUpdate(self, event):
        """"""

        attributes = event.attr

        self._update_buttoncell(attributes["button_cell"])

        self.Refresh()

        event.Skip()
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);
   }
743553
def _update_events(self):
        """"""
        events = self._skybell.dev_cache(self, CONST.EVENT) or {}

        for activity in self._activities:
            event = activity.get(CONST.EVENT)
            created_at = activity.get(CONST.CREATED_AT)

            old_event = events.get(event)

            if old_event and created_at < old_event.get(CONST.CREATED_AT):
                continue
            else:
                events[event] = activity

        self._skybell.update_dev_cache(
            self,
            {
                CONST.EVENT: events
            })
712445
private void setCalendar(Calendar c, boolean update) {
		if (c == null) {
			setDate(null);
		}
		Calendar oldCalendar = calendar;
		calendar = c;

		if (update) {
			// Thanks to Jeff Ulmer for correcting a bug in the sequence :)
			yearChooser.setYear(c.get(Calendar.YEAR));
			monthChooser.setMonth(c.get(Calendar.MONTH));
			dayChooser.setDay(c.get(Calendar.DATE));
		}

		firePropertyChange("calendar", oldCalendar, calendar);
	}
380884
def update(self):
        """"""
        _LOGGER.debug("Querying the device..")
        time = datetime.now()
        value = struct.pack('BBBBBBB', PROP_INFO_QUERY,
                            time.year % 100, time.month, time.day,
                            time.hour, time.minute, time.second)

        self._conn.make_request(PROP_WRITE_HANDLE, value)