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:energy.usef.agr.workflow.plan.connection.forecast.CreateConnectionForecastEventTrigger.java

License:Apache License

private long createIntervalPeriod() {
    return Days
            .days(Integer.parseInt(configAgr.getProperty(ConfigAgrParam.AGR_CONNECTION_FORECAST_DAYS_INTERVAL)))
            .toStandardDuration().getMillis();
}

From source file:energy.usef.agr.workflow.plan.create.aplan.FinalizeAPlansEventTrigger.java

License:Apache License

private long createIntervalPeriod() {
    return Days.days(ONE_DAY).toStandardDuration().getMillis();
}

From source file:energy.usef.brp.workflow.plan.commonreferencequery.BrpCommonReferenceQueryEventTrigger.java

License:Apache License

private long createIntervalPeriod() {
    return Days.days(configBrp.getIntegerProperty(ConfigBrpParam.BRP_INITIALIZE_PLANBOARD_DAYS_INTERVAL))
            .toStandardDuration().getMillis();
}

From source file:energy.usef.dso.workflow.plan.connection.forecast.DsoCommonReferenceQueryEventTrigger.java

License:Apache License

private long createIntervalPeriod() {
    return Days
            .days(Integer/*  ww  w .j  av a  2s. c o m*/
                    .parseInt(configDso.getProperty(ConfigDsoParam.DSO_INITIALIZE_PLANBOARD_DAYS_INTERVAL)))
            .toStandardDuration().getMillis();
}

From source file:energy.usef.dso.workflow.plan.connection.forecast.DsoCreateConnectionForecastEventTrigger.java

License:Apache License

private long createIntervalPeriod() {
    return Days
            .days(Integer.parseInt(configDso.getProperty(ConfigDsoParam.DSO_CONNECTION_FORECAST_DAYS_INTERVAL)))
            .toStandardDuration().getMillis();
}

From source file:griffon.plugins.jodatime.editors.DaysPropertyEditor.java

License:Apache License

private Days parse(Number number) {
    return Days.days(abs(number.intValue()));
}

From source file:griffon.plugins.jodatime.JodatimeExtension.java

License:Apache License

public static Days toDays(Number number) {
    return Days.days(abs(number.intValue()));
}

From source file:griffon.plugins.scaffolding.atoms.DaysValue.java

License:Apache License

@Override
public void setValue(Object value) {
    if (value == null || value instanceof Days) {
        super.setValue(value);
    } else if (value instanceof Number) {
        super.setValue(Days.days(abs(((Number) value).intValue())));
    } else {//from w  w w .  j  a v a2 s . c  o m
        throw new IllegalArgumentException("Invalid value " + value);
    }
}

From source file:influent.server.utilities.ResultFormatter.java

License:MIT License

public static String formatDur(FL_Duration d) {
    if (d == null)
        return "";

    int t = d.getNumIntervals().intValue();
    if (t == 0)/*from  w w  w  .  j a  va  2s . c  om*/
        return "-";

    ReadablePeriod period = null;
    switch (d.getInterval()) {
    case SECONDS:
        period = Seconds.seconds(t);
        break;
    case HOURS:
        period = Hours.hours(t);
        break;
    case DAYS:
        period = Days.days(t);
        break;
    case WEEKS:
        period = Weeks.weeks(t);
        break;
    case MONTHS:
        period = Months.months(t);
        break;
    case QUARTERS:
        period = Months.months(t * 3);
        break;
    case YEARS:
        period = Years.years(t);
        break;
    }

    PeriodFormatter formatter = new PeriodFormatterBuilder().printZeroAlways().minimumPrintedDigits(2)
            .appendHours().appendSeparator(":").printZeroAlways().minimumPrintedDigits(2).appendMinutes()
            .appendSeparator(":").printZeroAlways().minimumPrintedDigits(2).appendSeconds().toFormatter();
    final String ftime = formatter.print(DateTimeParser.normalize(new Period(period)));

    return ftime;
}

From source file:io.druid.server.coordinator.rules.DropRule.java

License:Open Source License

public static void main(String[] args) {
    System.out.println(new DateTime("2013-10-12").plus(Days.days(90)));
}