Module MaterialFX

Class MFXDatePicker

All Implemented Interfaces:
MFXMenuControl, Validated, Styleable, EventTarget, Skinnable

public class MFXDatePicker extends MFXTextField
A new, completely made from scratch, modern DatePicker for JavaFX.

A date picker is basically a text field which shows a popup containing a calendar for a specific month. For this reason, extends MFXTextField.

Compared to the previous implementation (that was just a wrapper for the original DatePicker), and the JavaFX's one, the new implementation is much simpler and customizable.

The main features of this new date picker are:

- Floating text (inherited from MFXTextField)

- Allows to fully control the popup (offset, alignment)

- Has three separate converters to convert LocalDate, Month and DayOfWeek to/from String. Those are specified with Suppliers. The default converters always take into account the date picker's localeProperty()

- Has a cell factory function to change the cells

- Allows specifying what to do when editing the text on confirm or cancel (by default, specifies in the skin, ENTER to commit and Ctrl+Shift+Z to cancel

- Allows to easily change the language by setting the localeProperty()

- Has a property to get the current date, plus it's possible to automatically or programmatically update it as days pass

- Allows to specify the range of years for the date picker

- Allows to specify the starting YearMonth of the calendar

- Also adds a new PseudoClass that activates when the popup opens

- Since inherits from MFXTextField, it can be also used as a Label, disabling edit and selection.

The next one is probably a very unique one. Unlike the old one or the JavaFX's one, this date picker allows you to easily change the way the calendar is filled by setting the gridAlgorithmProperty(). By default the date picker uses DateTimeUtils.fullIntMonthMatrix(Locale, YearMonth) to generate a 6x7 grid (rows x columns, it's a bi-dimensional array)