public static interface

DateBox.Format

com.google.gwt.user.datepicker.client.DateBox.Format
Known Indirect Subclasses

Class Overview

Implemented by a delegate to handle the parsing and formating of date values. The default DateBox.DefaultFormat uses a new DateBox.DefaultFormat instance.

Summary

Public Methods
abstract String format(DateBox dateBox, Date date)
Formats the provided date.
abstract Date parse(DateBox dateBox, String text, boolean reportError)
Parses the provided string as a date.
abstract void reset(DateBox dateBox, boolean abandon)
If the format did any modifications to the date box's styling, reset them now.

Public Methods

public abstract String format (DateBox dateBox, Date date)

Formats the provided date. Note, a null date is a possible input.

Parameters
dateBox the date box you are formatting
date the date to format
Returns
  • the formatted date as a string

public abstract Date parse (DateBox dateBox, String text, boolean reportError)

Parses the provided string as a date.

Parameters
dateBox the date box
text the string representing a date
reportError should the formatter indicate a parse error to the user?
Returns
  • the date created, or null if there was a parse error

public abstract void reset (DateBox dateBox, boolean abandon)

If the format did any modifications to the date box's styling, reset them now.

Parameters
dateBox the date box
abandon true when the current format is being replaced by another