Corregir que la fecha de las horas trabjadas sean solo una semana atras y ya no un mes
This commit is contained in:
parent
e3e9910696
commit
3acc1426bf
@ -168,16 +168,11 @@ public class HoursWorkedView extends BeanValidationForm<HoursWorked> implements
|
||||
|
||||
private void initializeDateField() {
|
||||
LocalDate today = LocalDate.now();
|
||||
YearMonth currentMonth = YearMonth.of(today.getYear(), today.getMonth());
|
||||
|
||||
LocalDate startOfMonth = currentMonth.atDay(1);
|
||||
|
||||
LocalDate lastWeekMonday = today.minusWeeks(1).with(java.time.DayOfWeek.MONDAY);
|
||||
LocalDate maxSelectableDate = today;
|
||||
|
||||
dateField.setMin(startOfMonth);
|
||||
dateField.setMin(lastWeekMonday);
|
||||
dateField.setMax(maxSelectableDate);
|
||||
dateField.setValue(today);
|
||||
|
||||
dateField.addValueChangeListener(event -> {
|
||||
LocalDate selectedDate = event.getValue();
|
||||
if (selectedDate != null) {
|
||||
@ -191,6 +186,7 @@ public class HoursWorkedView extends BeanValidationForm<HoursWorked> implements
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void saveHoursWorked() {
|
||||
if (isFormValid()) {
|
||||
HoursWorked hoursWorked = getEntity();
|
||||
|
Loading…
x
Reference in New Issue
Block a user