offset für Zeit vor Mittagspause eingebaut
This commit is contained in:
parent
903481e63b
commit
2af0eaebdd
@ -79,6 +79,10 @@ class LoadingBar {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String nextArg = args[2];
|
String nextArg = args[2];
|
||||||
|
if (OFFSET_PATTERN.matcher(nextArg).matches()) {
|
||||||
|
showLoadingBarMittagspause(startTime, Integer.parseInt(nextArg));
|
||||||
|
return;
|
||||||
|
}
|
||||||
verifyTimeFormat(nextArg, "Argument nach " + DaySection.MITTAG.getParam());
|
verifyTimeFormat(nextArg, "Argument nach " + DaySection.MITTAG.getParam());
|
||||||
var maxMittagspause = LocalTime.parse(nextArg, TIME_FORMATTER);
|
var maxMittagspause = LocalTime.parse(nextArg, TIME_FORMATTER);
|
||||||
showLoadingBarMittagspause(startTime, maxMittagspause);
|
showLoadingBarMittagspause(startTime, maxMittagspause);
|
||||||
@ -178,31 +182,33 @@ class LoadingBar {
|
|||||||
|
|
||||||
|
|
||||||
private static void printHelp() {
|
private static void printHelp() {
|
||||||
System.out.println(new StringBuilder().append("Mögliche Argumente für LoadingBar:\n")
|
System.out.println("Mögliche Argumente für LoadingBar:\n"
|
||||||
.append("Normalfall Vormittag (Mittagspause <= ").append(LATEST_LUNCH_TIME).append(")\n")
|
+ "Normalfall Vormittag (Mittagspause <= " + LATEST_LUNCH_TIME + ")\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.MITTAG.getParam()).append("\n")
|
+ TIME_FORMAT + " " + DaySection.MITTAG.getParam() + "\n"
|
||||||
.append("Vormittag mit expliziter Mittagspause (<= ").append(LATEST_LUNCH_TIME).append(")\n")
|
+ "Vormittag mit expliziter Mittagspause (<= " + LATEST_LUNCH_TIME + ")\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.MITTAG.getParam()).append(" ").append(TIME_FORMAT).append("\n")
|
+ TIME_FORMAT + " " + DaySection.MITTAG.getParam() + " " + TIME_FORMAT + "\n"
|
||||||
.append("Normalfall Nachmittag (Mittagspause ").append(MIN_LUNCH_DURATION).append(" min)\n")
|
+ "Vormittag mit abweichender Minutenanzahl Arbeitszeit\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append("\n")
|
+ TIME_FORMAT + " " + DaySection.MITTAG.getParam() + " -+mm\n"
|
||||||
.append("Nachmittag mit expliziter Länge Mittagspause (Mittagspause unter ").append(MIN_LUNCH_DURATION).append(" min wird auf ").append(MIN_LUNCH_DURATION).append(" min korrigiert)\n")
|
+ "Normalfall Nachmittag (Mittagspause " + MIN_LUNCH_DURATION + " min)\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append(" mm\n")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + "\n"
|
||||||
.append("Nachmittag mit explizitem Feierabend (Mittagspause je nach Minimum (s.u.))\n")
|
+ "Nachmittag mit expliziter Länge Mittagspause (Mittagspause unter " + MIN_LUNCH_DURATION + " min wird auf " + MIN_LUNCH_DURATION + " min korrigiert)\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append(" ").append(TIME_FORMAT).append("\n")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + " mm\n"
|
||||||
.append("Nachmittag mit abweichender Minutenanzahl Arbeitszeit\n")
|
+ "Nachmittag mit explizitem Feierabend (Mittagspause je nach Minimum (s.u.))\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append(" -+mm\n")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + " " + TIME_FORMAT + "\n"
|
||||||
.append("Nachmittag mit explizitem Feierabend u. expliziter Länge Mittagspause (Mittagspause unter Minimum (s.u.) wird auf Minimum korrigiert)\n")
|
+ "Nachmittag mit abweichender Minutenanzahl Arbeitszeit\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append(" mm ").append(TIME_FORMAT).append("\n")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + " -+mm\n"
|
||||||
.append("Nachmittag mit explizitem Feierabend u. abweichender Minutenanzahl Arbeitszeit\n")
|
+ "Nachmittag mit explizitem Feierabend u. expliziter Länge Mittagspause (Mittagspause unter Minimum (s.u.) wird auf Minimum korrigiert)\n"
|
||||||
.append(TIME_FORMAT).append(" ").append(DaySection.ZAPFENSTREICH.getParam()).append(" ").append(TIME_FORMAT).append(" -+mm\n\n")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + " mm " + TIME_FORMAT + "\n"
|
||||||
.append("Mittagspause minimum in Minuten:\n")
|
+ "Nachmittag mit explizitem Feierabend u. abweichender Minutenanzahl Arbeitszeit\n"
|
||||||
.append(" - bis ").append(MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH).append(" min (")
|
+ TIME_FORMAT + " " + DaySection.ZAPFENSTREICH.getParam() + " " + TIME_FORMAT + " -+mm\n\n"
|
||||||
.append(MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH / 60).append(" std): 0\n")
|
+ "Mittagspause minimum in Minuten:\n"
|
||||||
.append(" - bis ").append(MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH).append(" min + ")
|
+ " - bis " + MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH + " min ("
|
||||||
.append(MIN_LUNCH_DURATION).append(" min: Arbeitszeit - ").append(MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH).append(" min\n")
|
+ MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH / 60 + " std): 0\n"
|
||||||
.append(" - ab ").append(MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH).append(" min + ").append(MIN_LUNCH_DURATION).append(" min: ")
|
+ " - bis " + MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH + " min + "
|
||||||
.append(MIN_LUNCH_DURATION).append(" min\n")
|
+ MIN_LUNCH_DURATION + " min: Arbeitszeit - " + MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH + " min\n"
|
||||||
.toString());
|
+ " - ab " + MAX_NUMBER_WORK_MINS_WITHOUT_LUNCH + " min + " + MIN_LUNCH_DURATION + " min: "
|
||||||
|
+ MIN_LUNCH_DURATION + " min\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -211,6 +217,13 @@ class LoadingBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void showLoadingBarMittagspause(LocalTime startTime, int endTimeOffset) {
|
||||||
|
LocalTime endTime = startTime.plusMinutes(DEFAULT_NUMBER_WORK_MINS_BEFORE_LUNCH + endTimeOffset);
|
||||||
|
LocalTime trueEndTime = endTime.isAfter(LATEST_LUNCH_TIME) ? LATEST_LUNCH_TIME : endTime;
|
||||||
|
showLoadingBar(startTime, trueEndTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void showLoadingBarMittagspause(LocalTime startTime, LocalTime manualEndTime) {
|
private static void showLoadingBarMittagspause(LocalTime startTime, LocalTime manualEndTime) {
|
||||||
LocalTime endTime = manualEndTime != null ? manualEndTime : startTime.plusMinutes(DEFAULT_NUMBER_WORK_MINS_BEFORE_LUNCH);
|
LocalTime endTime = manualEndTime != null ? manualEndTime : startTime.plusMinutes(DEFAULT_NUMBER_WORK_MINS_BEFORE_LUNCH);
|
||||||
LocalTime trueEndTime = endTime.isAfter(LATEST_LUNCH_TIME) ? LATEST_LUNCH_TIME : endTime;
|
LocalTime trueEndTime = endTime.isAfter(LATEST_LUNCH_TIME) ? LATEST_LUNCH_TIME : endTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user