|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.extjs.gxt.ui.client.util.DateWrapper
public class DateWrapper
Provides a useful set of date related functions without using any deprecated APIs. Instances of this class are immutable and as such any mutation methods return new DateWrapper instances.
| Nested Class Summary | |
|---|---|
static class |
DateWrapper.Unit
Represents the different unit values that the add(Unit, int) method takes |
| Constructor Summary | |
|---|---|
DateWrapper()
Creates a new instance with the current time. |
|
DateWrapper(java.util.Date date)
Creates a new instance with the given date. |
|
DateWrapper(int year,
int month,
int day)
Creates a new instance with the given values. |
|
DateWrapper(long time)
Creates a new instance with the given time in milliseconds. |
|
| Method Summary | |
|---|---|
DateWrapper |
add(DateWrapper.Unit unit,
int quantity)
Provides a convenient method of performing basic date arithmetic. |
DateWrapper |
addDays(int days)
Returns a new DateWrapper with days added |
DateWrapper |
addHours(int hours)
Returns a new DateWrapper with hours added |
DateWrapper |
addMillis(int millis)
Returns a new DateWrapper with millis added |
DateWrapper |
addMinutes(int minutes)
Returns a new DateWrapper with minutes added |
DateWrapper |
addMonths(int months)
Returns a new DateWrapper with months added |
DateWrapper |
addSeconds(int seconds)
Returns a new DateWrapper with seconds added |
DateWrapper |
addYears(int years)
Returns a new DateWrapper with years added |
java.util.Date |
asDate()
Returns a new Date instance |
boolean |
before(DateWrapper dateWrapper)
|
DateWrapper |
clearTime()
Returns a new instance with the time portion (hours/minutes/seconds/milliseconds) cleared. |
DateWrapper |
clone()
|
int |
getDate()
Returns the day of the month |
int |
getDay()
Returns the day of the week |
int |
getDayInWeek()
Returns the day of the week |
int |
getDayOfYear()
Returns the day of the year |
int |
getDaysInMonth()
Returns the number of days in the month. |
DateWrapper |
getFirstDayOfMonth()
Returns the first date of the month. |
int |
getFullYear()
Returns the full year |
int |
getHours()
Returns the hour |
DateWrapper |
getLastDateOfMonth()
Returns the last date of the month. |
int |
getMilliseconds()
Returns the milliseconds |
int |
getMinutes()
Returns the minutes |
int |
getMonth()
Returns the month |
int |
getSeconds()
Returns the seconds |
long |
getTime()
Returns the time in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateWrapper()
public DateWrapper(java.util.Date date)
date - the datepublic DateWrapper(long time)
time - the time in milliseconds
public DateWrapper(int year,
int month,
int day)
year - the yearmonth - the monthday - the day| Method Detail |
|---|
public DateWrapper add(DateWrapper.Unit unit,
int quantity)
unit - the DateWrapper.Unitquantity - the quantity to add
addMillis(int),
addSeconds(int),
addMinutes(int),
addHours(int),
addDays(int),
addMonths(int),
addYears(int)public DateWrapper addMillis(int millis)
add(DateWrapper.Unit, int)public DateWrapper addSeconds(int seconds)
add(DateWrapper.Unit, int)public DateWrapper addMinutes(int minutes)
add(DateWrapper.Unit, int)public DateWrapper addHours(int hours)
add(DateWrapper.Unit, int)public DateWrapper addDays(int days)
add(DateWrapper.Unit, int)public DateWrapper addMonths(int months)
add(DateWrapper.Unit, int)public DateWrapper addYears(int years)
add(DateWrapper.Unit, int)public DateWrapper clearTime()
public java.util.Date asDate()
public int getDate()
public int getDay()
public int getDaysInMonth()
public DateWrapper getFirstDayOfMonth()
public DateWrapper getLastDateOfMonth()
public int getDayOfYear()
public int getDayInWeek()
public int getFullYear()
public int getMonth()
public int getHours()
public int getMinutes()
public int getSeconds()
public int getMilliseconds()
public long getTime()
public DateWrapper clone()
clone in class java.lang.Objectpublic boolean before(DateWrapper dateWrapper)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||