B4J Library jDatePickerEx - Datepicker with extra functionalities (JavaFx8)

Hi,

There is already a javafx 8 datepicker library on the forum, but I needed more functionalities, so I wrote my own datepicker library based on javafx 8 datepicker and localdate.

Example.jpg


jDatePickerEx:
This library offers more than the datepicker functions and methods. It includes parts of the Javafx "java.time.LocalDate" and also some custom functions that I created for my needs, like the autocorrect dates.
With this library, you can control the date picker, compare the selected date with another, get separately the selected year, month, day of month or add and subtract number of years, months weeks and days to the selected date and event more.

Requirements:
- Javafx 8 minimum
- Scene Builder 2.0 minimum

Events:
One event raised when the date has been changed.
B4X:
Sub datePicker_DateChanged
    'Your code here.
    'DatePicker.GetDate
    'DatePicker.GetYear
    'DatePicker.IsLeapYear
    'DatePicker.IsBefore(2015, 1, 1)
    '....
End Sub

How to use it:
  1. Copy the included jar and xml files to your additional libraries folder
  2. In SceneBuilder, create a DatePicker node and give it a name.
  3. Initialise jDatePickerEx with the datepicker node previously created.
I plan to add the option do disable cells later if I have time.

Comments and critics welcomed!
Jmon

Library updated : 2015-06-13:
- New methods:
-- SetDateToNull (I don't recommend to use this method because you will get NullPointerExceptions).

Library updated : 2015-01-9:
- New methods:
-- Editable : Get or set the editable state
-- Enabled: Get or set the enabled state
-- Opened: Get or set the opened state
-- Tag: Get or set an object tag linked to this node
-- Visible: Get or set the visible state

Library updated : 2015-01-26 (2):
- Event had wrong number or underscores.

Library updated : 2015-01-26:
- New method : Opened: opens or closes the datepicker pop-up. Also returns if the pop-ip is opened or not.
- You can now scroll the mouse on the edit area of the datepicker to add or substract one day.
 

Attachments

  • jDatePickerEx_Example.zip
    2.3 KB · Views: 865
  • jDatePickerEx_class.zip
    7 KB · Views: 827
Last edited:

jmon

Well-Known Member
Licensed User
Longtime User
Library updated : 2015-01-26:
- New method : Opened: opens or closes the datepicker pop-up. Also returns if the pop-ip is opened or not.
- You can now scroll the mouse on the edit area of the datepicker to add or substract one day.

Please download the latest file from the 1st post.
 

jmon

Well-Known Member
Licensed User
Longtime User
Library updated : 2015-01-9:
- New methods:
  • Editable : Get or set the editable state
  • Enabled: Get or set the enabled state
  • Opened: Get or set the opened state
  • Tag: Get or set an object tag linked to this node
  • Visible: Get or set the visible state

Please download the latest file from the 1st post.
 

jmon

Well-Known Member
Licensed User
Longtime User
I need a empty datapickerex. how can i do.
Thank
I've updated the library and added a new method "SetDateToNull".
Be careful with that because you will get nullPointerExceptions if you try to get the date or alter the date with some of the provided methods.
 
Top