Class Convert
java.lang.Object
com.github.lgooddatepicker.zinternaltools.Convert
Convert, This class allows the programmer to get or set a date picker date, using some other
popular data types besides the default java.time.LocalDate.
Example Usage:
// Create a date picker. DatePicker datePicker = new DatePicker(); // Set the date picker date, from a java.util.Date instance, using the default time zone. java.util.Date date = new java.util.Date(); datePicker.convert().setDateWithDefaultZone(date); // Get the date picker date, as a java.util.Date instance, using the default time zone. date = datePicker.convert().getDateWithDefaultZone();Implementation note: For code clarity, only the java.time packages should use import statements in this class. All other date related data types should be fully qualified in this class.
-
Constructor Summary
ConstructorsConstructorDescriptionConvert
(DatePicker parentDatePicker) Default Constructor, Supply the date picker that should be associated with this converter. -
Method Summary
Modifier and TypeMethodDescriptiongetDateWithDefaultZone, Returns the date picker value as a java.util.Date that was created using the system default time zone, or returns null.getDateWithZone
(ZoneId timezone) getDateWithZone, Returns the date picker value as a java.util.Date that was created using the specified time zone, or returns null.void
setDateWithDefaultZone
(Date javaUtilDate) setDateWithDefaultZone, Sets the date picker value from a java.util.Date using the system default time zone.void
setDateWithZone
(Date javaUtilDate, ZoneId timezone) setDateWithZone, Sets the date picker value from a java.util.Date using the specified time zone.
-
Constructor Details
-
Convert
Default Constructor, Supply the date picker that should be associated with this converter.
-
-
Method Details
-
getDateWithDefaultZone
getDateWithDefaultZone, Returns the date picker value as a java.util.Date that was created using the system default time zone, or returns null. This will return null when the date picker has no value. -
getDateWithZone
getDateWithZone, Returns the date picker value as a java.util.Date that was created using the specified time zone, or returns null. This will return null if either the date picker has no value, or if the supplied time zone was null. -
setDateWithDefaultZone
setDateWithDefaultZone, Sets the date picker value from a java.util.Date using the system default time zone. If either the date or the time zone are null, the date picker will be cleared. -
setDateWithZone
setDateWithZone, Sets the date picker value from a java.util.Date using the specified time zone. If either the date or the time zone are null, the date picker will be cleared.
-