Example usage for org.joda.time LocalDateTime plusMinutes

List of usage examples for org.joda.time LocalDateTime plusMinutes

Introduction

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

Prototype

public LocalDateTime plusMinutes(int minutes) 

Source Link

Document

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

Usage

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

private void initButtons() {
    settingsButton = new SettingsButton();
    settingsButton.setDisable(true);/*from   ww w . j  a va2 s.c  o  m*/

    settingsButton.setOnAction(e -> {

        configPanel.display("Foretag ndring");

    });

    dayShift = new ImageButton("pictures/morgen 60.png", "pictures/morgen 60 dark.png");
    dayShift.setOnAction(e -> {
        eveningShift.setUnPressed();
        nightShift.setUnPressed();

        //For at finde datoen og tiden p ugen skal der lgges nogle elementer til.
        //Frst lgges dayOfWeek til en ny variabel d. S hvis det fx er onsdag er
        //dayOfWeek 3 og der lgges derfor 3-1 til mandagen som er dayOfWeek 1,
        //Dette gr at man for den dato som onsdagen ligger p.
        LocalDateTime d = startTime.plusDays(dayOfWeek - 1);
        //Dernst defineres starttidspunktet. Dagsvagter starter per default 8:30.
        d = d.plusHours(8);
        d = d.plusMinutes(30);
        shift = new TimeInvestment(DAY_HOURS, DAY_MINUTES, d, employee, null);

        settingsButton.setDisable(false);
    });

    eveningShift = new ImageButton("pictures/aften 60.png", "pictures/aften 60 dark.png");
    eveningShift.setOnAction(e -> {
        dayShift.setUnPressed();
        nightShift.setUnPressed();

        LocalDateTime d = startTime.plusDays(dayOfWeek - 1);
        d = d.plusHours(15);
        d = d.plusMinutes(15);
        shift = new TimeInvestment(DAY_HOURS, DAY_MINUTES, d, employee, null);

        settingsButton.setDisable(false);
    });

    nightShift = new ImageButton("pictures/nat 60.png", "pictures/nat 60 dark.png");
    nightShift.setOnAction(e -> {
        dayShift.setUnPressed();
        eveningShift.setUnPressed();

        int id = 1;
        LocalDateTime d = startTime.plusDays(dayOfWeek - 1);
        d = d.plusHours(23);
        d = d.plusMinutes(30);
        shift = new TimeInvestment(DAY_HOURS, DAY_MINUTES, d, employee, null);

        settingsButton.setDisable(false);

    });

    configPanel.getChangeButton().setOnAction(e -> {
        makeChange();
    });
}

From source file:zxmax.tools.timerreview.serviceses.UINotificationService.java

License:Open Source License

public String getToolTipMessage() {
    if (null != getTomato()) {

        LocalDateTime startTime = getTomato().getStartTime();
        LocalDateTime endTimer = startTime.plusMinutes(getTomato().getDuration());
        LocalDateTime now = new LocalDateTime();

        final int minRemaining = Minutes.minutesBetween(now, endTimer).getMinutes() + 1;

        String timeLeft = "min: " + minRemaining;

        String toolTipMessage = timeLeft + " / " + System.getProperty("line.separator") + getTomato().getTitle()
                + " / " + System.getProperty("line.separator") + getTomato().getFocusOn();

        return toolTipMessage;

    } else {//from   w ww  . j a v a2s  .co  m
        return I18N.getLabel(this.getClass(), TIMER_ENDED_LABEL);
    }
}