| java.lang.Object org.apache.wicket.datetime.DateConverter
All known Subclasses: org.apache.wicket.datetime.PatternDateConverter, org.apache.wicket.datetime.StyleDateConverter,
DateConverter | abstract public class DateConverter implements IConverter(Code) | | Base class for Joda Time based date converters. It contains the logic to
parse and format, optionally taking the time zone difference between clients
and the server into account.
Converters of this class are best suited for per-component use.
author: eelcohillenius |
Constructor Summary | |
public | DateConverter(boolean applyTimeZoneDifference) Construct.
When applyTimeZoneDifference is true, the current time is applied on the
parsed date, and the date will be corrected for the time zone difference
between the server and the client. |
DateConverter | public DateConverter(boolean applyTimeZoneDifference)(Code) | | Construct.
When applyTimeZoneDifference is true, the current time is applied on the
parsed date, and the date will be corrected for the time zone difference
between the server and the client. For instance, if I'm in Seattle and
the server I'm working on is in Amsterdam, the server is 9 hours ahead.
So, if I'm inputting say 12/24 at a couple of hours before midnight, at
the server it is already 12/25. If this boolean is true, it will be
transformed to 12/25, while the client sees 12/24.
Parameters: applyTimeZoneDifference - whether to apply the difference in time zones between clientand server |
getApplyTimeZoneDifference | final public boolean getApplyTimeZoneDifference()(Code) | | Gets whether to apply the time zone difference when interpreting dates.
When true, the current time is applied on the parsed date, and the date
will be corrected for the time zone difference between the server and the
client. For instance, if I'm in Seattle and the server I'm working on is
in Amsterdam, the server is 9 hours ahead. So, if I'm inputting say 12/24
at a couple of hours before midnight, at the server it is already 12/25.
If this boolean is true, it will be transformed to 12/25, while the
client sees 12/24.
whether to apply the difference in time zones between client andserver |
getClientTimeZone | protected TimeZone getClientTimeZone()(Code) | | Gets the client's time zone.
The client's time zone or null |
getComponent | final public Component getComponent()(Code) | | optional component to use for determining the locale. |
getDatePattern | abstract public String getDatePattern()(Code) | | Gets the pattern that is used for printing and parsing |
getFormat | abstract protected DateTimeFormatter getFormat()(Code) | | formatter The formatter for the current conversion |
getLocale | protected Locale getLocale()(Code) | | Gets the locale to use.
the locale from either the component if that is set, or from thesession |
getTimeZone | protected DateTimeZone getTimeZone()(Code) | | Gets the server time zone. Override this method if you want to fix to a
certain time zone, regardless of what actual time zone the server is in.
The server time zone |
setComponent | final public void setComponent(Component component)(Code) | | Sets component for getting the locale
Parameters: component - optional component to use for determining the locale. |
|
|