Example usage for org.joda.time LocalTime minusMinutes

List of usage examples for org.joda.time LocalTime minusMinutes

Introduction

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

Prototype

public LocalTime minusMinutes(int minutes) 

Source Link

Document

Returns a copy of this time minus the specified number of minutes.

Usage

From source file:courtscheduler.persistence.CourtScheduleIO.java

License:Apache License

public static void requestBeforeTime(String request, Team team, DateConstraint badDates) {
    request = request.replace("before ", "");
    if (isAfternoon(request) == null) {
        warning("Could not determine a valid time from \"" + request
                + "\" on Request Before Time (\"before\") constraint" + EOL + "\tThe request was: \"" + request
                + "\"" + "\tFound in " + currentCell());
    }/*  w ww . jav a2s .  co  m*/
    LocalTime t = normalTime.parseLocalTime(request);
    // if we're saying not before an exact hour, we need to not schedule them to start AT that hour
    request = militaryTime.print(t.minusMinutes(1));
    badDates.addRestrictedTimes(
            badDates.makeTimeArray(DateConstraint.getInfo().getHumanReadableTime(0), request));
}

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

License:Apache License

private long createInitialDelay() {
    LocalTime localTime = new LocalTime(config.getProperty(ConfigParam.DAY_AHEAD_GATE_CLOSURE_TIME));
    localTime = localTime
            .minusMinutes(Integer.parseInt(configAgr.getProperty(ConfigAgrParam.AGR_FINALIZE_A_PLAN_PTUS))
                    * Integer.parseInt(config.getProperty(ConfigParam.PTU_DURATION)));
    return DateTimeUtil.millisecondDelayUntilNextTime(localTime);
}

From source file:energy.usef.brp.workflow.plan.aplan.finalize.FinalizeAPlansEventTrigger.java

License:Apache License

private long createInitialDelay() {
    LocalTime localTime = new LocalTime(config.getProperty(ConfigParam.DAY_AHEAD_GATE_CLOSURE_TIME));
    localTime = localTime.minusMinutes(
            Integer.parseInt(configBrp.getProperty(ConfigBrpParam.BRP_FINALIZE_APLANS_PTUS_BEFORE_GATE_CLOSURE))
                    * Integer.parseInt(config.getProperty(ConfigParam.PTU_DURATION)));
    return DateTimeUtil.millisecondDelayUntilNextTime(localTime);
}

From source file:javaapplication5.NewJFrame.java

public static LocalTime decreaseTime(LocalTime time, int h, int m) {
    time = time.minusHours(h);//from  www  .  j  a v  a  2 s .c om
    time = time.minusMinutes(m);
    return time;
}

From source file:org.pidome.misc.utils.TimeUtils.java

License:Apache License

/**
 * Calculates time difference base on minutes or hours.
 * Given a military time string with -10m or +10h it will return the time corresponding to this calculation
 * @param origTime The original time military format
 * @param differ This only takes whole military time notation including + or - signs: +00:10,+10:00,-01:26,-01:00
 * @return /*  ww w  .  j  av a 2s.co m*/
 */
public static String calcTimeDiff(String origTime, String differ) {
    LocalTime time = dateTimeFormatter.parseLocalTime(origTime);
    LocalTime differTime = dateTimeFormatter.parseLocalTime(differ.substring(1));
    LocalTime differStartTime = dateTimeFormatter.parseLocalTime("00:00");
    Long duration = new Duration(differStartTime.getMillisOfDay(), differTime.getMillisOfDay())
            .getStandardMinutes();
    if (differ.startsWith("-")) {
        return time.minusMinutes(duration.intValue()).toString(DateTimeFormat.forPattern("HH:mm"));
    } else if (differ.startsWith("+")) {
        return time.plusMinutes(duration.intValue()).toString(DateTimeFormat.forPattern("HH:mm"));
    }
    return origTime;
}