MaterialFX icon indicating copy to clipboard operation
MaterialFX copied to clipboard

Index Out Of Bound Error When Using MFXDatePicker

Open malintha-induwara opened this issue 1 year ago • 4 comments

Issue Description

A IndexOutOfBoundsException is thrown when using MFXDatePicker

Steps to Reproduce

1)Create a JavaFX application with an MFXDatePicker 2)Then just try to change the month or year while application is running

MRE


import io.github.palexdev.materialfx.controls.MFXDatePicker;
import io.github.palexdev.materialfx.utils.DateTimeUtils;
import io.github.palexdev.materialfx.utils.others.dates.DateStringConverter;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;

import java.net.URL;
import java.util.ResourceBundle;

public class TestController implements Initializable {

    @FXML
    private MFXDatePicker dp;

    @Override
    public void initialize(URL location, ResourceBundle resources) {
        dp.setGridAlgorithm(DateTimeUtils::partialIntMonthMatrix);
        dp.setConverterSupplier(() -> new DateStringConverter("dd/MM/yyyy", dp.getLocale()));
    }
}

error

malintha-induwara avatar Nov 14 '23 20:11 malintha-induwara