Example usage for org.joda.time LocalDateTime LocalDateTime

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

Introduction

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

Prototype

public LocalDateTime() 

Source Link

Document

Constructs an instance set to the current local time evaluated using ISO chronology in the default zone.

Usage

From source file:zxmax.tools.timerreview.domain.Tomato.java

License:Open Source License

public Tomato(String focusOn) {
    this.focusOn = focusOn;
    startTime = new LocalDateTime();
}

From source file:zxmax.tools.timerreview.gui.EndTimerWindow.java

License:Open Source License

private TomatoReview saveTomatoReview() {

    // create and save a tomato review only if no one is linked to the
    // current tomato.
    List list = basicDao.namedQuery("ExistTomatoReviewForTomato", "tomatoId", tomato.getId());

    TomatoReview review = null;//from  w w  w  .jav  a  2  s .co m
    if (list.size() == 0) {
        review = new TomatoReview(tomato, taDone.getText(), taNote.getText());

        basicDao.save(review);
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        sb.append(" " + (new LocalDateTime()).toString("dd/MM/yyyy E") + " ");
        sb.append(tomato.getStartTime().toString("HH:mm"));
        sb.append(" - ");
        sb.append(new LocalDateTime().toString("HH:mm"));
        sb.append(" ]");
        sb.append(System.getProperty("line.separator"));

        reportLogger.info(sb.toString());

        reportLogger.info(I18N.getLabel(this.getClass(), TIMER_LOGGER_FATTO)
                + System.getProperty("line.separator") + review.getReallyDone());
        reportLogger.info(I18N.getLabel(this.getClass(), TIMER_LOGGER_NOTE)
                + System.getProperty("line.separator") + review.getProblemsRaised());

        return review;

    } else {
        // closeWindow();
        return basicDao.load(TomatoReview.class, ((TomatoReview) list.get(0)).getId());
    }
}

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 {// w  ww . j  a va 2  s  .  c o  m
        return I18N.getLabel(this.getClass(), TIMER_ENDED_LABEL);
    }
}