Example usage for org.joda.time Minutes minus

List of usage examples for org.joda.time Minutes minus

Introduction

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

Prototype

public Minutes minus(Minutes minutes) 

Source Link

Document

Returns a new instance with the specified number of minutes taken away.

Usage

From source file:view.popups.shift.ShiftManualPopup.java

public Minutes getEndLocalMinutes() throws Exception {
    String inputErrorMessage = "Der kan kun indtastes tal i de 4 felter";

    Minutes startToEnd;
    LocalTime endTime = null;/*from  w ww.j ava  2s .c  o m*/
    LocalTime startTime = getStartLocalTime();

    int endHH = Integer.parseInt(tEndHH.getText());
    int endMM = Integer.parseInt(tEndMM.getText());

    endTime = new LocalTime(endHH, endMM, 0);

    //samlede minutter fra start til slut
    startToEnd = Minutes.minutesBetween(startTime, endTime);
    //Da vi allerede fr timer fra getEndLocalHours, s har vi kun brug for
    //det ekstra minutantal der er i en time. Ellers fr vi det samlede minutantal
    //for hele vagten. Vi har kun brug for dem der gr ud over timerne. 
    //Alts minuser vi det samlede minuttantal med det afrundede timeantal for at f "addedMinutes"
    Minutes addedMinutes = startToEnd.minus(getEndLocalHours().toStandardMinutes());

    return addedMinutes;
}