Skip to content

Index Out Of Bound Error When Using MFXDatePicker #352

@malintha-induwara

Description

@malintha-induwara

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions