Skip to content
Snippets Groups Projects
Commit 972c92c6 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Closed #80 - datapicker weird behaviour

parent 281a82a6
Branches
Tags
2 merge requests!104merge v_1_2_0 into master,!100merge charts into v_1_2_0
......@@ -17,7 +17,6 @@ import de.deadlocker8.budgetmaster.ui.cells.RepeatingDayCell;
import de.deadlocker8.budgetmaster.ui.cells.SmallCategoryCell;
import fontAwesome.FontIcon;
import fontAwesome.FontIconType;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.Button;
......@@ -214,8 +213,17 @@ public class NewPaymentController
//preselect correct month and year
DateTime currentDate = controller.getCurrentDate();
datePicker.setValue(LocalDate.now().withYear(currentDate.getYear()).withMonth(currentDate.getMonthOfYear()).withDayOfMonth(currentDate.getDayOfMonth()));
Platform.runLater(()->{datePicker.getEditor().clear();});
if(DateTime.now().getDayOfMonth() > currentDate.dayOfMonth().withMaximumValue().getDayOfMonth())
{
currentDate = currentDate.dayOfMonth().withMaximumValue();
}
LocalDate currentLocalDate = LocalDate.now().withYear(currentDate.getYear())
.withMonth(currentDate.getMonthOfYear())
.withDayOfMonth(currentDate.getDayOfMonth());
datePicker.setValue(currentLocalDate);
datePicker.setEditable(false);
//Platform.runLater(()->{datePicker.getEditor().clear();});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment