Class YAHOO.widget.DateMath

Object
   |
   +--YAHOO.widget.DateMath

class YAHOO.widget.DateMath

Field Summary [top]

String DAY
Constant field representing Day 
String MONTH
Constant field representing Month 
Integer ONE_DAY_MS
Constant field representing one day, in milliseconds 
String WEEK
Constant field representing Week 
String YEAR
Constant field representing Year 

Method Summary [top]

Object add
Adds the specified amount of time to the this instance. 
Boolean after
Determines whether a given date is after another date on the calendar. 
Boolean before
Determines whether a given date is before another date on the calendar. 
Date clearTime
Clears the time fields from a given date, effectively setting the time to midnight. 
Date findMonthEnd
Gets the last day of a month containing a given date. 
Date findMonthStart
Gets the first day of a month containing a given date. 
Integer getDayOffset
Calculates the number of days the specified date is from January 1 of the specified calendar year. 
Date getJan1
Retrieves a JavaScript Date object representing January 1 of any given year. 
Integer getWeekNumber
Calculates the week number for the given date. 
Boolean isMonthOverlapWeek
Determines if a given week overlaps two different months. 
Boolean isYearOverlapWeek
Determines if a given week overlaps two different years. 
Object subtract
Subtracts the specified amount of time from the this instance. 

Field Detail [top]

DAY

String   DAY
Constant field representing Day

MONTH

String   MONTH
Constant field representing Month

ONE_DAY_MS

Integer   ONE_DAY_MS
Constant field representing one day, in milliseconds

WEEK

String   WEEK
Constant field representing Week

YEAR

String   YEAR
Constant field representing Year

Constructor Detail [top]

YAHOO.widget.DateMath

YAHOO.widget.DateMath

Method Detail [top]

add

Object add
Adds the specified amount of time to the this instance.

after

Boolean after
Determines whether a given date is after another date on the calendar.
Returns:
true if the date occurs after the compared date; false if not.

before

Boolean before
Determines whether a given date is before another date on the calendar.
Returns:
true if the date occurs before the compared date; false if not.

clearTime

Date clearTime
Clears the time fields from a given date, effectively setting the time to midnight.
Returns:
The JavaScript Date cleared of all time fields

findMonthEnd

Date findMonthEnd
Gets the last day of a month containing a given date.
Returns:
The JavaScript Date representing the last day of the month

findMonthStart

Date findMonthStart
Gets the first day of a month containing a given date.
Returns:
The JavaScript Date representing the first day of the month

getDayOffset

Integer getDayOffset
Calculates the number of days the specified date is from January 1 of the specified calendar year. Passing January 1 to this function would return an offset value of zero.
Returns:
The number of days since January 1 of the given year

getJan1

Date getJan1
Retrieves a JavaScript Date object representing January 1 of any given year.
Returns:
January 1 of the calendar year specified.

getWeekNumber

Integer getWeekNumber
Calculates the week number for the given date. This function assumes that week 1 is the week in which January 1 appears, regardless of whether the week consists of a full 7 days. The calendar year can be specified to help find what a the week number would be for a given date if the date overlaps years. For instance, a week may be considered week 1 of 2005, or week 53 of 2004. Specifying the optional calendarYear allows one to make this distinction easily.
Returns:
The week number of the given date.

isMonthOverlapWeek

Boolean isMonthOverlapWeek
Determines if a given week overlaps two different months.
Returns:
true if the date overlaps two different months.

isYearOverlapWeek

Boolean isYearOverlapWeek
Determines if a given week overlaps two different years.
Returns:
true if the date overlaps two different years.

subtract

Object subtract
Subtracts the specified amount of time from the this instance.