java.lang.Object
com.github.lgooddatepicker.zinternaltools.Convert

public class Convert extends Object
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

    Constructors
    Constructor
    Description
    Convert(DatePicker parentDatePicker)
    Default Constructor, Supply the date picker that should be associated with this converter.
  • Method Summary

    Modifier and Type
    Method
    Description
    getDateWithDefaultZone, Returns the date picker value as a java.util.Date that was created using the system default time zone, or returns null.
    getDateWithZone, Returns the date picker value as a java.util.Date that was created using the specified time zone, or returns null.
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Convert

      public Convert(DatePicker parentDatePicker)
      Default Constructor, Supply the date picker that should be associated with this converter.
  • Method Details

    • getDateWithDefaultZone

      public Date 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

      public Date 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. This will return null if either the date picker has no value, or if the supplied time zone was null.
    • setDateWithDefaultZone

      public void setDateWithDefaultZone(Date javaUtilDate)
      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

      public void setDateWithZone(Date javaUtilDate, ZoneId timezone)
      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.