public class

DateRecord

extends Date
java.lang.Object
   ↳ java.util.Date
     ↳ com.google.gwt.i18n.client.impl.DateRecord

Class Overview

Implementation detail of DateTimeFormat -- not a public API and subject to change. DateRecord class exposes almost the same set of interface as Date class with only a few exceptions. The main purpose is the record all the information during parsing phase and resolve them in a later time when all information can be processed together.

Summary

Constants
int AM
int PM
Public Constructors
DateRecord()
Initialize DateExt object with default value.
Public Methods
boolean calcDate(Date date, boolean strict)
calcDate uses all the field available so far to fill a Date object.
void setAmbiguousYear(boolean ambiguousYear)
Set ambiguous year field.
void setAmpm(int ampm)
Set morning/afternoon field.
void setDayOfMonth(int day)
Set dayOfMonth field.
void setDayOfWeek(int dayOfWeek)
Set dayOfWeek field.
void setEra(int era)
Set Era field.
void setHours(int hours)
Set hour field.
void setMilliseconds(int milliseconds)
Set milliseconds field.
void setMinutes(int minutes)
Set minute field.
void setMonth(int month)
Set month field.
void setSeconds(int seconds)
Set seconds field.
void setTzOffset(int tzOffset)
Set timezone offset, in minutes.
void setYear(int value)
Set year field.
[Expand]
Inherited Methods
From class java.util.Date
From class java.lang.Object
From interface java.lang.Comparable

Constants

public static final int AM

Constant Value: 0 (0x00000000)

public static final int PM

Constant Value: 1 (0x00000001)

Public Constructors

public DateRecord ()

Initialize DateExt object with default value. Here we use -1 for most of the field to indicate that field is not set.

Public Methods

public boolean calcDate (Date date, boolean strict)

calcDate uses all the field available so far to fill a Date object. For those information that is not provided, the existing value in 'date' will be kept. Ambiguous year will be resolved after the date/time values are resolved. If the strict option is set to true, calcDate will calculate certain invalid dates by wrapping around as needed. For example, February 30 will wrap to March 2.

Parameters
date The Date object being filled. Its value should be set to an acceptable default before pass in to this method
strict true to be strict when parsing
Returns
  • true if successful, otherwise false.

public void setAmbiguousYear (boolean ambiguousYear)

Set ambiguous year field. This flag indicates that a 2 digit years's century need to be determined by its date/time value. This can only be resolved after its date/time is known.

Parameters
ambiguousYear true if it is ambiguous year.

public void setAmpm (int ampm)

Set morning/afternoon field.

Parameters
ampm ampm value.

public void setDayOfMonth (int day)

Set dayOfMonth field.

Parameters
day dayOfMonth value

public void setDayOfWeek (int dayOfWeek)

Set dayOfWeek field.

Parameters
dayOfWeek day of the week.

public void setEra (int era)

Set Era field.

Parameters
era era value being set.

public void setHours (int hours)

Set hour field.

Parameters
hours hour value.

public void setMilliseconds (int milliseconds)

Set milliseconds field.

Parameters
milliseconds milliseconds value.

public void setMinutes (int minutes)

Set minute field.

Parameters
minutes minute value.

public void setMonth (int month)

Set month field.

Parameters
month month value.

public void setSeconds (int seconds)

Set seconds field.

Parameters
seconds second value.

public void setTzOffset (int tzOffset)

Set timezone offset, in minutes.

Parameters
tzOffset timezone offset.

public void setYear (int value)

Set year field.

Parameters
value year value.