arreglar-funcionalidad #88

Merged
alex merged 5 commits from arreglar-funcionalidad into main 2024-11-28 13:59:32 +00:00
Showing only changes of commit 3acc1426bf - Show all commits

View File

@ -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();