Skip to content

Commit

Permalink
#118 Fix proposal for minutes to show at least quarter hour precision
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausRicharz committed May 24, 2022
1 parent caaa0c9 commit 3ae7b76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/tb/common/GlobalConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@ public class GlobalConstants {
public static final String ZERO_DHM = "00:00:00";
public static final String ZERO_HM = "00:00";

public static final int QUARTER_HOUR_IN_MINUTES = 15;
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ public ActionForward executeAuthenticated(ActionMapping mapping, AddDailyReportF
int hour = Integer.parseInt(DateUtils.formatHours(now));
int minute = Integer.parseInt(DateUtils.formatMinutes(now));

// propose minutes with quarter hour precision
minute = minute - minute % GlobalConstants.QUARTER_HOUR_IN_MINUTES;

if ((beginTime[0] < hour || beginTime[0] == hour && beginTime[1] < minute) && selectedDate.equals(today)) {
form.setSelectedMinuteEnd(minute);
form.setSelectedHourEnd(hour);
Expand Down

0 comments on commit 3ae7b76

Please sign in to comment.