Example usage for org.joda.time Days Days

List of usage examples for org.joda.time Days Days

Introduction

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

Prototype

private Days(int days) 

Source Link

Document

Creates a new instance representing a number of days.

Usage

From source file:org.mifos.calendar.DayOfWeek.java

License:Open Source License

public static Days sundayAsDay() {
    return Days.days(sunday());
}

From source file:org.mifos.calendar.WorkingDay.java

License:Open Source License

public static boolean isWorkingDay(final DateTime day, final List<Days> workingDays) {
    return workingDays.contains(Days.days(day.dayOfWeek().get()));
}

From source file:org.mifos.config.FiscalCalendarRules.java

License:Open Source License

public List<Days> getWorkingDaysAsJodaTimeDays() {

    List<Days> jodaWorkingDays = new ArrayList<Days>();

    List<WeekDay> workingDaysAsWeekDays = getWorkingDays();
    for (WeekDay weekDay : workingDaysAsWeekDays) {

        Days jodaWeekDay = Days.days(WeekDay.getJodaDayOfWeekThatMatchesMifosWeekDay(weekDay.getValue()));

        jodaWorkingDays.add(jodaWeekDay);
    }/* w ww .ja va 2  s.  c o  m*/

    return jodaWorkingDays;
}

From source file:org.obm.imap.archive.beans.RepeatKind.java

License:Open Source License

public static ReadablePeriod toPeriod(RepeatKind repeatKind, int period) {
    switch (repeatKind) {
    case DAILY:/*from w  w w. j  a  va2  s .c  o m*/
        return Days.days(period);
    case WEEKLY:
        return Weeks.weeks(period);
    case MONTHLY:
        return Months.months(period);
    case YEARLY:
        return Years.years(period);
    default:
        throw new IllegalArgumentException("Unknown repeat kind: " + repeatKind);
    }
}

From source file:org.rhq.server.metrics.MetricsServer.java

License:Open Source License

public void setRawDataAgeLimit(int rawDataAgeLimit) {
    if (rawDataAgeLimit > RAW_DATA_AGE_LIMIT_MAX) {
        throw new IllegalArgumentException("The requested limit, " + rawDataAgeLimit + ", exceeds the max age "
                + "limit of " + RAW_DATA_AGE_LIMIT_MAX);
    }/*from w  w w  . j a  va 2  s. c  o m*/
    this.rawDataAgeLimit = Days.days(rawDataAgeLimit);
}

From source file:org.zkoss.ganttz.timetracker.zoom.DetailFiveTimeTrackerState.java

License:Open Source License

@Override
protected ReadablePeriod getPeriodFirstLevel() {
    return Days.days(7);
}

From source file:org.zkoss.ganttz.timetracker.zoom.DetailFiveTimeTrackerState.java

License:Open Source License

@Override
protected ReadablePeriod getPeriodSecondLevel() {
    return Days.days(1);
}