FieldDate

public final class FieldDate extends Field

Adds a date picker to an Input. Dates must be in the format "YYYY-MM-DD"

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

FieldDate(String name)
FieldDate(String name, long milliseconds)
FieldDate(String name, String dateString)

Public Method Summary

FieldDate
clone()
static FieldDate
fromJson(JSONObject json)
Date
String
String
void
setDate(Date date)
Sets this field to the specified Date.
boolean
setFromString(String text)
Sets the values of the field from a string.
void
setTime(long millis)
Sets this field to a specific time.

Inherited Method Summary

Public Constructors

public FieldDate (String name)

Parameters
name

public FieldDate (String name, long milliseconds)

Parameters
name
milliseconds

public FieldDate (String name, String dateString)

Parameters
name
dateString

Public Methods

public FieldDate clone ()

public static FieldDate fromJson (JSONObject json)

Parameters
json

public Date getDate ()

Returns
  • The date in this field.

public String getLocalizedDateString ()

Returns
  • The string format for the date in this field.

public String getSerializedValue ()

Returns
  • The value serialized into a string.

public void setDate (Date date)

Sets this field to the specified Date.

Parameters
date

public boolean setFromString (String text)

Sets the values of the field from a string.

This is used for setting values of all types of fields when loading a workspace from XML. It is also used, however, as the primary means of setting text fields (e.g., inputs, labels, dates).

There should be a concrete implementation for each field type.

Parameters
text The text value for this field from the XML.
Returns
  • True if the value was set, false otherwise.

public void setTime (long millis)

Sets this field to a specific time.

Parameters
millis The time in millis since UNIX Epoch.