Transforms self to an all-day event.

        The event will span all the days from the begin to the end day.
429590
def make_all_day(self):
        
        if self.all_day:
            # Do nothing if we already are a all day event
            return

        begin_day = self.begin.floor('day')
        end_day = self.end.floor('day')

        self._begin = begin_day

        # for a one day event, we don't need a _end_time
        if begin_day == end_day:
            self._end_time = None
        else:
            self._end_time = end_day + timedelta(days=1)

        self._duration = None
        self._begin_precision = 'day'
605913
public static Calendar next(Calendar self) {
        Calendar result = (Calendar) self.clone();
        result.add(Calendar.DAY_OF_YEAR, 1);
        return result;
    }
252803
def rebuildMonth( self ):
        
        # make sure we start at 0 for sunday vs. 7 for sunday
        day_map     = dict([(i+1, i+1) for i in range(7)])
        day_map[7]  = 0
        
        today   = QDate.currentDate()
        curr    = self.currentDate()
        first   = QDate(curr.year(), curr.month(), 1)
        last    = QDate(curr.year(), curr.month(), curr.daysInMonth())
        first   = first.addDays(-day_map[first.dayOfWeek()])
        last    = last.addDays(6-day_map[last.dayOfWeek()])
        
        cols    = 7
        rows    = (first.daysTo(last) + 1) / cols
        
        hlines  = []
        vlines  = []
        
        padx    = 6
        pady    = 6
        header  = 24
        
        w       = self.width() - (2 * padx)
        h       = self.height() - (2 * pady)
        
        dw      = (w / cols) - 1
        dh      = ((h - header) / rows) - 1
        
        x0      = padx
        y0      = pady + header
        
        x       = x0
        y       = y0
        
        for row in range(rows + 1):
            hlines.append(QLine(x0, y, w, y))
            y += dh
        
        for col in range(cols + 1):
            vlines.append(QLine(x, y0, x, h))
            x += dw
        
        self._buildData['grid'] = hlines + vlines
        
        # draw the date fields
        date = first
        row  = 0
        col  = 0
        
        # draw the headers
        x = x0
        y = pady
        
        regular_text = []
        mid_text     = []
        self._buildData['regular_text'] = regular_text
        self._buildData['mid_text']     = mid_text
        
        for day in ('Sun', 'Mon','Tue','Wed','Thu','Fri','Sat'):
            regular_text.append((x + 5,
                                 y,
                                 dw,
                                 y0,
                                 Qt.AlignLeft | Qt.AlignVCenter,
                                 day))
            x += dw
        
        for i in range(first.daysTo(last) + 1):
            top    = (y0 + (row * dh))
            left   = (x0 + (col * dw))
            rect   = QRectF(left - 1, top, dw, dh)
            
            # mark the current date on the calendar
            if ( date == curr ):
                self._buildData['curr_date'] = rect
            
            # mark today's date on the calendar
            elif ( date == today ):
                self._buildData['today'] = rect
            
            # determine how to draw the calendar
            format = 'd'
            if ( date.day() == 1 ):
                format = 'MMM d'
            
            # determine the color to draw the text
            if ( date.month() == curr.month() ):
                text = regular_text
            else:
                text = mid_text
            
            # draw the text
            text.append((left + 2,
                         top + 2,
                         dw - 4,
                         dh - 4,
                         Qt.AlignTop | Qt.AlignLeft,
                         date.toString(format)))
            
            # update the limits
            if ( not i ):
                self._minimumDate = date
            self._maximumDate = date
            
            self._dateGrid[date.toJulianDay()] = ((row, col), rect)
            if ( col == (cols - 1) ):
                row += 1
                col = 0
            else:
                col += 1
                
            date = date.addDays(1)
99855
private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
   {
      LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
      boolean remainderInserted = false;
      
      for (TimephasedWork assignment : list)
      {
         if (remainderInserted)
         {
            assignment.setStart(DateHelper.addDays(assignment.getStart(), 1));
            remainderInserted = false;
         }

         while (assignment != null)
         {
            Date startDay = DateHelper.getDayStartDate(assignment.getStart());
            Date finishDay = DateHelper.getDayStartDate(assignment.getFinish());

            // special case - when the finishday time is midnight, it's really the previous day...
            if (assignment.getFinish().getTime() == finishDay.getTime())
            {
               finishDay = DateHelper.addDays(finishDay, -1);
            }

            if (startDay.getTime() == finishDay.getTime())
            {
               Duration totalWork = assignment.getTotalAmount();
               Duration assignmentWork = getAssignmentWork(calendar, assignment);
               if ((totalWork.getDuration() - assignmentWork.getDuration()) > EQUALITY_DELTA)
               {
                  assignment.setTotalAmount(assignmentWork);
                  result.add(assignment);
                  Duration remainingWork = Duration.getInstance(totalWork.getDuration() - assignmentWork.getDuration(), TimeUnit.MINUTES);
                  
                  Date remainderStart = DateHelper.addDays(finishDay, 1);
                  Date remainderFinish = DateHelper.addDays(remainderStart, 1);
                  
                  TimephasedWork remainder = new TimephasedWork();
                  remainder.setStart(remainderStart);
                  remainder.setFinish(remainderFinish);
                  remainder.setTotalAmount(remainingWork);
                  result.add(remainder);

                  remainderInserted = true;
               }
               else
               {
                  result.add(assignment);
               }
               break;
            }

            TimephasedWork[] split = splitFirstDay(calendar, assignment);
            if (split[0] != null)
            {
               result.add(split[0]);
            }

            if (assignment.equals(split[1]))
            {
               break;
            }

            assignment = split[1];
         }
      }
     
      list.clear();
      list.addAll(result);
   }
310028
function makeCalendar(char) {
    let calendar = function (id) {
        if (id === undefined) {
            return calendar.history();
        }
        else {
            return new EventImpl(char, id);
        }
    };
    calendar.history = function (fromId) {
        return char.agent.request('get_characters_character_id_calendar', {
            path: { character_id: char.id }, query: { from_event: fromId }
        }, char.ssoToken);
    };
    return calendar;
}
1320906
function handleEvent(handler, day, modifiers) {
  if (!handler) {
    return undefined;
  }
  return function (e) {
    e.persist();
    handler(day, modifiers, e);
  };
}
143591
def _getEventsByDay(self, request, firstDay, lastDay):
        
        return getAllEventsByDay(request, firstDay, lastDay, home=self)
649992
def _yield_week_day_dynamic(self):
        
        # Iterate over all weeks
        for week in range(1, self.duration + 1):
            # Iterate over all days
            for day in self.days:
                # Iterate over all main exercises
                for dynamic_ex in day.dynamic_exercises:
                    yield (week, day, dynamic_ex)
783823
function moveEvents(events, dayDelta, minuteDelta, allDay) {
		minuteDelta = minuteDelta || 0;
		for (var e, len=events.length, i=0; i<len; i++) {
			e = events[i];
			if (allDay !== undefined) {
				e.allDay = allDay;
			}
			addMinutes(addDays(e.start, dayDelta, true), minuteDelta);
			if (e.end) {
				e.end = addMinutes(addDays(e.end, dayDelta, true), minuteDelta);
			}
			normalizeEvent(e, options);
		}
	}
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);
        }
    }
909554
function(date, allDay) { // this function is called when something is dropped
		
			// retrieve the dropped element's stored Event Object
			var originalEventObject = $(this).data('eventObject');
			var $extraEventClass = $(this).attr('data-class');
			
			
			// we need to copy it, so that multiple events don't have a reference to the same object
			var copiedEventObject = $.extend({}, originalEventObject);
			
			// assign it the date that was reported
			copiedEventObject.start = date;
			copiedEventObject.allDay = allDay;
			if($extraEventClass) copiedEventObject['className'] = [$extraEventClass];
			
			// render the event on the calendar
			// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
			$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
			
			// is the "remove after drop" checkbox checked?
			if ($('#drop-remove').is(':checked')) {
				// if so, remove the element from the "Draggable Events" list
				$(this).remove();
			}
			
		}
960077
def every(time)
            ms = Scheduler.parse_in(time)
            event = Repeat.new(self, ms)
            event.progress &Proc.new if block_given?
            schedule(event)
            event
        end
436467
def replace(self, year=None, month=None, day=None):
        

        if year is None:
            year = self.year
        if month is None:
            month = self.month
        if day is None:
            day = self.day

        if year > 0:
            cls = date
        else:
            cls = extended_date

        return cls(
            year,
            month,
            day
        )
866654
def setDateTimeEnd(self, dtime):
        
        self._dateEnd = dtime.date()
        self._timeEnd = dtime.time()
        self._allDay = False
46042
@UiHandler("m_everyDay")
    void onDaysValueChange(ValueChangeEvent<String> event) {

        if (handleChange()) {
            m_controller.setInterval(m_everyDay.getText());
        }
    }
148082
public Calendar getStartOfDay(long time) {

        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(time);
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        Calendar result = Calendar.getInstance();
        result.set(Calendar.YEAR, year);
        result.set(Calendar.MONTH, month);
        result.set(Calendar.DAY_OF_MONTH, day);
        return result;
    }
1101932
def _getEventsOnDay(self, request, day):
        """"""
        return getAllEventsByDay(request, day, day, home=self)[0]