0

I'm working on an application and using JavaFX. I am using the built-in DatePicker but the calendar starts from Sunday, as visible on the image below. How to make the calendar start on Monday?

enter image description here

Dada
  • 6,313
  • 7
  • 24
  • 43
  • Note that if you're running this on a JVM where the default locale is one in which the standard is for Monday to be the first day of the week, this will happen automatically. – James_D Nov 23 '21 at 15:31

1 Answers1

0

I found a solution for this:

@FXML 
private DatePicker date;

//In the initialize method you can use the following code:

@Override
public void initialize(URL location, ResourceBundle resources) {
    date.setOnShowing(e -> Locale.setDefault(Locale.Category.FORMAT, Locale.UK));
    //...
}