Example usage for org.joda.time DateTime plusDays

List of usage examples for org.joda.time DateTime plusDays

Introduction

In this page you can find the example usage for org.joda.time DateTime plusDays.

Prototype

public DateTime plusDays(int days) 

Source Link

Document

Returns a copy of this datetime plus the specified number of days.

Usage

From source file:org.oxymores.chronix.core.State.java

License:Apache License

public void run(Place p, MessageProducer pjProducer, Session session, String calendarOccurrenceID,
        boolean updateCalendarPointer, boolean outOfPlan, boolean outOfChainLaunch, UUID level0Id,
        UUID level1Id, UUID level2Id, UUID level3Id, CalendarPointer cpToUpdate, Date virtualTime,
        EnvironmentValue... params) {/*from  ww w  . jav a 2  s  . co  m*/
    DateTime now = DateTime.now();

    PipelineJob pj = new PipelineJob();

    // Common fields
    pj.setLevel0IdU(level0Id);
    pj.setLevel1IdU(level1Id);
    pj.setLevel2IdU(level2Id);
    pj.setLevel3IdU(level3Id);
    pj.setMarkedForRunAt(now.toDate());
    pj.setPlace(p);
    pj.setState(this);
    pj.setStatus("ENTERING_QUEUE");
    pj.setApplication(this.application);
    pj.setOutsideChain(outOfChainLaunch);
    pj.setIgnoreCalendarUpdating(!updateCalendarPointer);
    pj.setOutOfPlan(outOfPlan);
    pj.setVirtualTime(virtualTime);

    // Warning and kill
    if (this.warnAfterMn != null) {
        pj.setWarnNotEndedAt(now.plusMinutes(this.warnAfterMn).toDate());
    } else {
        pj.setWarnNotEndedAt(now.plusDays(1).toDate());
    }

    if (this.killAfterMn != null) {
        pj.setKillAt(now.plusMinutes(this.killAfterMn).toDate());
    }

    // Environment variables from the State itself
    for (EnvironmentParameter ep : this.envParams) {
        pj.addValue(ep.key, ep.value);
    }

    // Environment variables passed from other jobs through the event (or
    // manually set)
    for (EnvironmentValue ep : params) {
        if (ep.getKey().startsWith("CHR_")) {
            // Don't propagate auto variables
            continue;
        }
        pj.addValue(ep.getKey(), ep.getValue());
    }

    // Environment variables auto
    pj.addValue("CHR_STATEID", this.id.toString());
    pj.addValue("CHR_CHAINID", this.chain.id.toString());
    pj.addValue("CHR_LAUNCHID", pj.getId());
    pj.addValue("CHR_JOBNAME", this.represents.name);
    pj.addValue("CHR_PLACEID", p.id.toString());
    pj.addValue("CHR_PLACENAME", p.name);
    pj.addValue("CHR_PLACEGROUPID", this.runsOn.id.toString());
    pj.addValue("CHR_PLACEGROUPNAME", this.runsOn.name);

    // Calendar update
    if (this.usesCalendar()) {
        pj.setCalendarOccurrenceID(calendarOccurrenceID);
        pj.setCalendar(calendar);

        log.debug("Since this state will run, calendar update!");
        cpToUpdate.setRunning(true);
        if (updateCalendarPointer) {
            cpToUpdate.setLastStartedOccurrenceId(cpToUpdate.getNextRunOccurrenceId());
        }

        pj.addValue(Constants.ENV_AUTO_CHR_CALENDAR, this.calendar.name);
        pj.addValue(Constants.ENV_AUTO_CHR_CHR_CALENDARID, this.calendar.id.toString());
        pj.addValue(Constants.ENV_AUTO_CHR_CHR_CALENDARDATE, cpToUpdate.getNextRunOccurrenceId());
    } else {
        pj.addValue(Constants.ENV_AUTO_CHR_CALENDAR, "NONE");
        pj.addValue(Constants.ENV_AUTO_CHR_CHR_CALENDARID, "NONE");
        pj.addValue(Constants.ENV_AUTO_CHR_CHR_CALENDARDATE, "NONE");
    }

    // Send it (commit is done by main engine later)
    String qName = String.format(Constants.Q_PJ, p.getNode().getBrokerName());
    try {
        SenderHelpers.sendPipelineJobToRunner(pj, p.getNode().getHost(), pjProducer, session, false);
    } catch (JMSException e1) {
        log.error(
                "Could not enqueue a state for launch. Scheduler will still go on, but this may affect its operations.",
                e1);
    }

    // Done
    log.debug(String.format("State (%s - chain %s) was enqueued for launch on place %s (queue %s)",
            this.represents.getName(), this.chain.getName(), p.name, qName));
}

From source file:org.oxymores.chronix.engine.SelfTriggerAgent.java

License:Apache License

@Override
public void run() {
    long msToWait = 0;

    while (run) {
        // Wait for the required number of seconds
        try {//from   w w w .  jav a  2 s  . co m
            if (loop.tryAcquire(msToWait, TimeUnit.MILLISECONDS)) {
                // Test is only important because ignoring a result is a Sonar alert...
            }
        } catch (InterruptedException e) {
            return;
        }
        if (!run) {
            // Don't bother doing the final loop
            break;
        }

        try {
            this.triggering.acquire();
        } catch (InterruptedException e1) {
            // Not an issue
        }

        // Log
        log.debug("Self trigger agent loops");
        this.preLoopHook();
        if (!run) {
            break;
        }

        // Init the next loop time at a huge value
        DateTime now = DateTime.now();
        DateTime loopVirtualTime = this.nextLoopVirtualTime;
        this.nextLoopVirtualTime = now.plusDays(1).minusMillis(now.getMillisOfDay());

        // Loop through all the self triggered nodes and get their next loop virtual time
        jpaTransaction.begin();
        DateTime tmp = null;
        for (ActiveNodeBase n : this.nodes) {
            try {
                tmp = n.selfTrigger(producerEvents, jmsSession, ctx, em, loopVirtualTime);
            } catch (Exception e) {
                log.error("Error triggering clocks and the like", e);
            }
            if (tmp.compareTo(this.nextLoopVirtualTime) < 0) {
                this.nextLoopVirtualTime = tmp;
            }
        }

        // Commit
        try {
            jmsSession.commit();
        } catch (JMSException e) {
            log.error("Oups", e);
            return;
        }
        jpaTransaction.commit();

        this.triggering.release();

        msToWait = getNextLoopTime();
        log.debug(String.format("Self trigger agent will loop again in %s milliseconds", msToWait));
    }
}

From source file:org.oxymores.chronix.planbuilder.CalendarBuilder.java

License:Apache License

public static Calendar buildWorkDayCalendar(Application a, int year) {
    Calendar cal1 = new Calendar();
    cal1.setName("Week worked days");
    cal1.setDescription("All days from monday to friday for the whole year");
    cal1.setManualSequence(false);// ww  w  . j a  v  a 2  s .c o  m
    a.addCalendar(cal1);

    DateTime d = new DateTime(year, 1, 1, 0, 0);
    while (d.getYear() == year) {
        if (d.getDayOfWeek() <= 5) {
            new CalendarDay(d.toString(OCCURRENCE_DAY_FORMAT), cal1);
        }
        d = d.plusDays(1);
    }

    return cal1;
}

From source file:org.oxymores.chronix.planbuilder.CalendarBuilder.java

License:Apache License

public static Calendar buildWeekDayCalendar(Application a, int year) {
    Calendar cal1 = new Calendar();
    cal1.setName("All days");
    cal1.setDescription("All days for the whole year");
    cal1.setManualSequence(false);//from  w ww. j  a v a2s .  co  m
    a.addCalendar(cal1);

    DateTime d = new DateTime(year, 1, 1, 0, 0);
    while (d.getYear() == year) {
        new CalendarDay(d.toString(OCCURRENCE_DAY_FORMAT), cal1);
        d = d.plusDays(1);
    }

    return cal1;
}

From source file:org.projectforge.business.teamcal.event.TeamEventUtils.java

License:Open Source License

public static TeamEventDO createTeamEventDO(final VEvent event, java.util.TimeZone timeZone) {
    final TeamEventDO teamEvent = new TeamEventDO();
    teamEvent.setTimeZone(timeZone);//w ww  .j a v a 2s.co m
    final DtStart dtStart = event.getStartDate();
    final DtEnd dtEnd = event.getEndDate();
    if (dtStart != null && dtEnd == null) {
        if (dtStart.getValue().contains("VALUE=DATE") == true
                && dtStart.getValue().contains("VALUE=DATE-TIME") == false) {
            teamEvent.setAllDay(true);
        }
    }
    Timestamp timestamp = ICal4JUtils.getSqlTimestamp(dtStart.getDate());
    teamEvent.setStartDate(timestamp);
    if (teamEvent.isAllDay() == true) {
        final org.joda.time.DateTime jodaTime = new org.joda.time.DateTime(event.getEndDate().getDate());
        final net.fortuna.ical4j.model.Date fortunaEndDate = new net.fortuna.ical4j.model.Date(
                jodaTime.plusDays(-1).toDate());
        timestamp = new Timestamp(fortunaEndDate.getTime());
    } else {
        timestamp = ICal4JUtils.getSqlTimestamp(event.getEndDate().getDate());
    }
    teamEvent.setEndDate(timestamp);
    if (event.getUid() != null) {
        teamEvent.setExternalUid(event.getUid().getValue());
    }
    if (event.getLocation() != null) {
        teamEvent.setLocation(event.getLocation().getValue());
    }
    if (event.getDescription() != null) {
        teamEvent.setNote(event.getDescription().getValue());
    }
    if (event.getSummary() != null) {
        teamEvent.setSubject(event.getSummary().getValue());
    } else {
        teamEvent.setSubject("");
    }
    if (event.getOrganizer() != null) {
        teamEvent.setOrganizer(event.getOrganizer().getValue());
    }
    @SuppressWarnings("unchecked")
    final List<VAlarm> alarms = event.getAlarms();
    if (alarms != null && alarms.size() >= 1) {
        final Dur dur = alarms.get(0).getTrigger().getDuration();
        if (dur != null) { // Might be null.
            // consider weeks
            int weeksToDays = 0;
            if (dur.getWeeks() != 0) {
                weeksToDays = dur.getWeeks() * DURATION_OF_WEEK;
            }
            if (dur.getDays() != 0) {
                teamEvent.setReminderDuration(dur.getDays() + weeksToDays);
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.DAYS);
            } else if (dur.getHours() != 0) {
                teamEvent.setReminderDuration(dur.getHours());
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.HOURS);
            } else if (dur.getMinutes() != 0) {
                teamEvent.setReminderDuration(dur.getMinutes());
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.MINUTES);
            }
        }
    }
    final RRule rule = (RRule) event.getProperty(Property.RRULE);
    if (rule != null) {
        teamEvent.setRecurrenceRule(rule.getValue());
    }
    final ExDate exDate = (ExDate) event.getProperty(Property.EXDATE);
    if (exDate != null) {
        teamEvent.setRecurrenceExDate(exDate.getValue());
    }
    return teamEvent;
}

From source file:org.projectforge.calendar.ICal4JUtils.java

License:Open Source License

public static VEvent createVEvent(final Date startDate, final Date endDate, final String uid,
        final String summary, final boolean allDay, final TimeZone timezone) {
    VEvent vEvent;//from   w  w w  .ja  va  2  s  .  c o m
    if (allDay == true) {
        final Date startUtc = CalendarUtils.getUTCMidnightDate(startDate);
        final Date endUtc = CalendarUtils.getUTCMidnightDate(endDate);
        final net.fortuna.ical4j.model.Date fortunaStartDate = new net.fortuna.ical4j.model.Date(startUtc);
        final org.joda.time.DateTime jodaTime = new org.joda.time.DateTime(endUtc);
        // requires plus 1 because one day will be omitted by calendar.
        final net.fortuna.ical4j.model.Date fortunaEndDate = new net.fortuna.ical4j.model.Date(
                jodaTime.plusDays(1).toDate());
        vEvent = new VEvent(fortunaStartDate, fortunaEndDate, summary);
    } else {
        final net.fortuna.ical4j.model.DateTime fortunaStartDate = new net.fortuna.ical4j.model.DateTime(
                startDate);
        fortunaStartDate.setTimeZone(timezone);
        final net.fortuna.ical4j.model.DateTime fortunaEndDate = new net.fortuna.ical4j.model.DateTime(endDate);
        fortunaEndDate.setTimeZone(timezone);
        vEvent = new VEvent(fortunaStartDate, fortunaEndDate, summary);
        vEvent.getProperties().add(timezone.getVTimeZone().getTimeZoneId());
    }
    vEvent.getProperties().add(new Uid(uid));
    return vEvent;
}

From source file:org.projectforge.plugins.teamcal.event.TeamEventUtils.java

License:Open Source License

public static TeamEventDO createTeamEventDO(final VEvent event) {
    final TeamEventDO teamEvent = new TeamEventDO();
    final DtStart dtStart = event.getStartDate();
    final String value = dtStart.toString();
    if (value.indexOf("VALUE=DATE") >= 0) {
        teamEvent.setAllDay(true);//from  w  ww .j  a v a 2 s. co m
    }
    Timestamp timestamp = ICal4JUtils.getSqlTimestamp(dtStart.getDate());
    teamEvent.setStartDate(timestamp);
    if (teamEvent.isAllDay() == true) {
        final org.joda.time.DateTime jodaTime = new org.joda.time.DateTime(event.getEndDate().getDate());
        final net.fortuna.ical4j.model.Date fortunaEndDate = new net.fortuna.ical4j.model.Date(
                jodaTime.plusDays(-1).toDate());
        timestamp = new Timestamp(fortunaEndDate.getTime());
    } else {
        timestamp = ICal4JUtils.getSqlTimestamp(event.getEndDate().getDate());
    }
    teamEvent.setEndDate(timestamp);
    if (event.getUid() != null) {
        teamEvent.setExternalUid(event.getUid().getValue());
    }
    if (event.getLocation() != null) {
        teamEvent.setLocation(event.getLocation().getValue());
    }
    if (event.getDescription() != null) {
        teamEvent.setNote(event.getDescription().getValue());
    }
    if (event.getSummary() != null) {
        teamEvent.setSubject(event.getSummary().getValue());
    } else {
        teamEvent.setSubject("");
    }
    if (event.getOrganizer() != null) {
        teamEvent.setOrganizer(event.getOrganizer().getValue());
    }
    @SuppressWarnings("unchecked")
    final List<VAlarm> alarms = event.getAlarms();
    if (alarms != null && alarms.size() >= 1) {
        final Dur dur = alarms.get(0).getTrigger().getDuration();
        if (dur != null) { // Might be null.
            // consider weeks
            int weeksToDays = 0;
            if (dur.getWeeks() != 0) {
                weeksToDays = dur.getWeeks() * DURATION_OF_WEEK;
            }
            if (dur.getDays() != 0) {
                teamEvent.setReminderDuration(dur.getDays() + weeksToDays);
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.DAYS);
            } else if (dur.getHours() != 0) {
                teamEvent.setReminderDuration(dur.getHours());
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.HOURS);
            } else if (dur.getMinutes() != 0) {
                teamEvent.setReminderDuration(dur.getMinutes());
                teamEvent.setReminderDurationUnit(ReminderDurationUnit.MINUTES);
            }
        }
    }
    final RRule rule = (RRule) event.getProperty(Property.RRULE);
    if (rule != null) {
        teamEvent.setRecurrenceRule(rule.getValue());
    }
    final ExDate exDate = (ExDate) event.getProperty(Property.EXDATE);
    if (exDate != null) {
        teamEvent.setRecurrenceExDate(exDate.getValue());
    }
    return teamEvent;
}

From source file:org.projectforge.web.address.BirthdayEventsProvider.java

License:Open Source License

private DateTime getDate(final DateTime start, final DateTime end, final int month, final int dayOfMonth) {
    DateTime day = start;
    int paranoiaCounter = 0;
    do {//from  w w w.j  a  v  a2 s  .  c o  m
        if (day.getMonthOfYear() == month && day.getDayOfMonth() == dayOfMonth) {
            return day;
        }
        day = day.plusDays(1);
        if (++paranoiaCounter > 1000) {
            log.error(
                    "Paranoia counter exceeded! Dear developer, please have a look at the implementation of getDate.");
            break;
        }
    } while (day.isAfter(end) == false);
    return null;
}

From source file:org.projectforge.web.calendar.TimesheetEventsProvider.java

License:Open Source License

/**
 * @see org.projectforge.web.calendar.MyFullCalendarEventsProvider#buildEvents(org.joda.time.DateTime,
 *      org.joda.time.DateTime)//from  w  ww. j  a va2  s . com
 */
@Override
protected void buildEvents(final DateTime start, final DateTime end) {
    totalDuration = 0;
    for (int i = 0; i < durationsPerDayOfMonth.length; i++) {
        durationsPerDayOfMonth[i] = 0;
    }
    for (int i = 0; i < durationsPerDayOfYear.length; i++) {
        durationsPerDayOfYear[i] = 0;
    }
    final Integer userId = calFilter.getTimesheetUserId();
    if (userId == null) {
        return;
    }
    breaksMap = new HashMap<String, TimesheetDO>();
    int breaksCounter = 0;
    final TimesheetFilter filter = new TimesheetFilter();
    filter.setUserId(userId);
    filter.setStartTime(start.toDate());
    filter.setStopTime(end.toDate());
    filter.setOrderType(OrderDirection.ASC);
    timesheets = timesheetDao.getList(filter);
    boolean longFormat = false;
    days = Days.daysBetween(start, end).getDays();
    if (days < 10) {
        // Week or day view:
        longFormat = true;
        month = null;
        firstDayOfMonth = null;
    } else {
        // Month view:
        final DateTime currentMonth = new DateTime(start.plusDays(10),
                ThreadLocalUserContext.getDateTimeZone()); // Now we're definitely in the right
        // month.
        month = currentMonth.getMonthOfYear();
        firstDayOfMonth = currentMonth.withDayOfMonth(1);
    }
    if (CollectionUtils.isEmpty(timesheets) == false) {
        DateTime lastStopTime = null;
        for (final TimesheetDO timesheet : timesheets) {
            final DateTime startTime = new DateTime(timesheet.getStartTime(),
                    ThreadLocalUserContext.getDateTimeZone());
            final DateTime stopTime = new DateTime(timesheet.getStopTime(),
                    ThreadLocalUserContext.getDateTimeZone());
            if (stopTime.isBefore(start) == true || startTime.isAfter(end) == true) {
                // Time sheet doesn't match time period start - end.
                continue;
            }
            if (calFilter.isShowBreaks() == true) {
                if (lastStopTime != null && DateHelper.isSameDay(stopTime, lastStopTime) == true
                        && startTime.getMillis() - lastStopTime.getMillis() > 60000) {
                    // Show breaks between time sheets of one day (> 60s).
                    final Event breakEvent = new Event();
                    breakEvent.setEditable(false);
                    final String breakId = String.valueOf(++breaksCounter);
                    breakEvent.setClassName(Const.BREAK_EVENT_CLASS_NAME).setId(breakId).setStart(lastStopTime)
                            .setEnd(startTime).setTitle(getString("timesheet.break"));
                    breakEvent.setTextColor("#666666").setBackgroundColor("#F9F9F9").setColor("#F9F9F9");
                    events.put(breakId, breakEvent);
                    final TimesheetDO breakTimesheet = new TimesheetDO().setStartDate(lastStopTime.toDate())
                            .setStopTime(startTime.getMillis());
                    breaksMap.put(breakId, breakTimesheet);
                }
                lastStopTime = stopTime;
            }
            final long duration = timesheet.getDuration();
            final MyWicketEvent event = new MyWicketEvent();
            final String id = "" + timesheet.getId();
            event.setClassName(Const.EVENT_CLASS_NAME);
            event.setId(id);
            event.setStart(startTime);
            event.setEnd(stopTime);
            final String title = CalendarHelper.getTitle(timesheet);
            if (longFormat == true) {
                // Week or day view:
                event.setTitle(title + "\n" + getToolTip(timesheet) + "\n" + formatDuration(duration, false));
            } else {
                // Month view:
                event.setTitle(title);
            }
            if (month != null && startTime.getMonthOfYear() != month && stopTime.getMonthOfYear() != month) {
                // Display time sheets of other month as grey blue:
                event.setTextColor("#222222").setBackgroundColor("#ACD9E8").setColor("#ACD9E8");
            }
            events.put(id, event);
            if (month == null || startTime.getMonthOfYear() == month) {
                totalDuration += duration;
                addDurationOfDay(startTime.getDayOfMonth(), duration);
            }
            final int dayOfYear = startTime.getDayOfYear();
            addDurationOfDayOfYear(dayOfYear, duration);
            event.setTooltip(getString("timesheet"),
                    new String[][] { { title }, { timesheet.getLocation(), getString("timesheet.location") },
                            { KostFormatter.formatLong(timesheet.getKost2()), getString("fibu.kost2") },
                            { TaskFormatter.getTaskPath(timesheet.getTaskId(), true, OutputType.PLAIN),
                                    getString("task") },
                            { timesheet.getDescription(), getString("description") } });
        }
    }
    if (calFilter.isShowStatistics() == true) {
        // Show statistics: duration of every day is shown as all day event.
        DateTime day = start;
        final Calendar cal = DateHelper.getCalendar();
        cal.setTime(start.toDate());
        final int numberOfDaysInYear = cal.getActualMaximum(Calendar.DAY_OF_YEAR);
        int paranoiaCounter = 0;
        do {
            if (++paranoiaCounter > 1000) {
                log.error(
                        "Paranoia counter exceeded! Dear developer, please have a look at the implementation of buildEvents.");
                break;
            }
            final int dayOfYear = day.getDayOfYear();
            final long duration = durationsPerDayOfYear[dayOfYear];
            final boolean firstDayOfWeek = day.getDayOfWeek() == ThreadLocalUserContext.getJodaFirstDayOfWeek();
            if (firstDayOfWeek == false && duration == 0) {
                day = day.plusDays(1);
                continue;
            }
            final Event event = new Event().setAllDay(true);
            final String id = "s-" + (dayOfYear);
            event.setId(id);
            event.setStart(day);
            final String durationString = formatDuration(duration, false);
            if (firstDayOfWeek == true) {
                // Show week of year at top of first day of week.
                long weekDuration = 0;
                for (short i = 0; i < 7; i++) {
                    int d = dayOfYear + i;
                    if (d > numberOfDaysInYear) {
                        d -= numberOfDaysInYear;
                    }
                    weekDuration += durationsPerDayOfYear[d];
                }
                final StringBuffer buf = new StringBuffer();
                buf.append(getString("calendar.weekOfYearShortLabel")).append(DateHelper.getWeekOfYear(day));
                if (days > 1 && weekDuration > 0) {
                    // Show total sum of durations over all time sheets of current week (only in week and month view).
                    buf.append(": ").append(formatDuration(weekDuration, false));
                }
                if (duration > 0) {
                    buf.append(", ").append(durationString);
                }
                event.setTitle(buf.toString());
            } else {
                event.setTitle(durationString);
            }
            event.setTextColor("#666666").setBackgroundColor("#F9F9F9").setColor("#F9F9F9");
            event.setEditable(false);
            events.put(id, event);
            day = day.plusDays(1);
        } while (day.isAfter(end) == false);
    }
}

From source file:org.projectforge.web.humanresources.HRPlanningEventsProvider.java

License:Open Source License

/**
 * @see org.projectforge.web.calendar.MyFullCalendarEventsProvider#buildEvents(org.joda.time.DateTime, org.joda.time.DateTime)
 *//*from   w ww  . ja v  a 2  s. c o m*/
@Override
protected void buildEvents(final DateTime start, final DateTime end) {
    if (calendarFilter.isShowPlanning() == false) {
        // Don't show plannings.
        return;
    }
    final HRPlanningFilter filter = new HRPlanningFilter();
    Integer timesheetUserId = calendarFilter.getTimesheetUserId();
    if (timesheetUserId == null) {
        timesheetUserId = PFUserContext.getUserId();
    }
    filter.setUserId(timesheetUserId);
    filter.setStartTime(start.toDate());
    filter.setStopTime(end.toDate());
    final List<HRPlanningDO> list = hrPlanningDao.getList(filter);
    if (list == null) {
        return;
    }
    for (final HRPlanningDO planning : list) {
        if (planning.getEntries() == null) {
            continue;
        }
        final DateTime week = new DateTime(planning.getWeek(), PFUserContext.getDateTimeZone());
        for (final HRPlanningEntryDO entry : planning.getEntries()) {
            putEvent(entry, week, "week", 6, entry.getUnassignedHours());
            putEvent(entry, week, "mo", 0, entry.getMondayHours());
            putEvent(entry, week.plusDays(1), "tu", 0, entry.getTuesdayHours());
            putEvent(entry, week.plusDays(2), "we", 0, entry.getWednesdayHours());
            putEvent(entry, week.plusDays(3), "th", 0, entry.getThursdayHours());
            putEvent(entry, week.plusDays(4), "fr", 0, entry.getFridayHours());
            putEvent(entry, week.plusDays(5), "we", 1, entry.getWeekendHours());
        }
    }
}