YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
used for adding, subtracting, and comparing dates.
|
CSS_CALENDAR : Object |
DateMath |
|
|
CSS_CELL : Object |
DateMath |
|
|
CSS_CELL_BOTTOM : Object |
DateMath |
|
|
CSS_CELL_HIGHLIGHT1 : Object |
DateMath |
|
|
CSS_CELL_HIGHLIGHT2 : Object |
DateMath |
|
|
CSS_CELL_HIGHLIGHT3 : Object |
DateMath |
|
|
CSS_CELL_HIGHLIGHT4 : Object |
DateMath |
|
|
CSS_CELL_HOVER : Object |
DateMath |
|
|
CSS_CELL_LEFT : Object |
DateMath |
|
|
CSS_CELL_OOB : Object |
DateMath |
|
|
CSS_CELL_OOM : Object |
DateMath |
|
|
CSS_CELL_RESTRICTED : Object |
DateMath |
|
|
CSS_CELL_RIGHT : Object |
DateMath |
|
|
CSS_CELL_SELECTABLE : Object |
DateMath |
|
|
CSS_CELL_SELECTED : Object |
DateMath |
|
|
CSS_CELL_TODAY : Object |
DateMath |
|
|
CSS_CELL_TOP : Object |
DateMath |
|
|
CSS_CONTAINER : Object |
DateMath |
|
|
CSS_FOOTER : Object |
DateMath |
|
|
CSS_HEADER : Object |
DateMath |
|
|
CSS_HEADER_TEXT : Object |
DateMath |
|
|
CSS_NAV_LEFT : Object |
DateMath |
|
|
CSS_NAV_RIGHT : Object |
DateMath |
|
|
CSS_ROW_FOOTER : Object |
DateMath |
|
|
CSS_ROW_HEADER : Object |
DateMath |
|
|
CSS_SINGLE : Object |
DateMath |
|
|
CSS_WEEKDAY_CELL : Object |
DateMath |
|
|
CSS_WEEKDAY_ROW : Object |
DateMath |
|
|
DATE<static> : String |
DateMath |
<static> Type constant used for renderers to represent an individual date (M/D/Y) |
|
DAY : String |
DateMath |
<static> Constant field representing Day |
|
DISPLAY_DAYS<static> : Number |
DateMath |
<static> Constant that represents the total number of date cells that are displayed in a given month |
|
Locale : Object |
DateMath |
The local object which contains the Calendar's locale settings |
|
MONTH : String |
DateMath |
<static> Constant field representing Month |
|
MONTH<static> : String |
DateMath |
<static> Type constant used for renderers to represent a month across any year |
|
MONTH_DAY<static> : String |
DateMath |
<static> Type constant used for renderers to represent an individual date across any year (M/D) |
|
ONE_DAY_MS : Number |
DateMath |
<static> Constant field representing one day, in milliseconds |
|
Options : Object |
DateMath |
The local object which contains the Calendar's options |
|
RANGE<static> : String |
DateMath |
<static> Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y) |
|
STOP_RENDER<static> : String |
DateMath |
<static> Constant used for halting the execution of the remainder of the render stack |
|
Style : Object |
DateMath |
Collection of Style constants for the Calendar |
|
WEEK : String |
DateMath |
<static> Constant field representing Week |
|
WEEKDAY<static> : String |
DateMath |
<static> Type constant used for renderers to represent a weekday |
|
YEAR : String |
DateMath |
<static> Constant field representing Year |
|
browser : String |
DateMath |
Returns a string representing the current browser. |
|
cellDates : Array[](Number[]) |
DateMath |
The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays... |
|
cells : HTMLTableCellElement[] |
DateMath |
The collection of calendar table cells |
|
cfg : Number
@default |
DateMath |
The position of the year in a month/day/year date string
@config MDY_YEAR_POSITION |
|
domEventMap : Object |
DateMath |
A map of DOM event handlers to attach to cells associated with specific CSS class names |
|
https : String |
DateMath |
<static> The path to be used for images loaded for the Calendar |
|
id : String |
DateMath |
The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page. |
|
index : Number |
DateMath |
The index of this item in the parent group |
|
oDomContainer : HTMLElement |
DateMath |
The DOM element reference that points to this calendar's container element. The calendar will be inserted into this e... |
|
parent : CalendarGroup |
DateMath |
The parent CalendarGroup, only to be set explicitly by the parent group |
|
renderStack : Array[] |
DateMath |
The list of render functions, along with required parameters, used to render cells. |
|
today : Date |
DateMath |
A Date object representing today's date. |
|
add(Date date , String field , Number amount ) : Date |
DateMath |
Adds the specified amount of time to the this instance. |
|
addMonthRenderer(Number month , Function fnRender ) : void |
DateMath |
Adds a month to the render stack. The function reference passed to this method will be executed
when a date cell matc... |
|
addMonths(Number count ) : void |
DateMath |
Adds the designated number of months to the current calendar month, and sets the current
calendar page date to the ne... |
|
addRenderer(String sDates , Function fnRender ) : void |
DateMath |
Adds a renderer to the render stack. The function reference passed to this method will be executed
when a date cell m... |
|
addWeekdayRenderer(Number weekday , Function fnRender ) : void |
DateMath |
Adds a weekday to the render stack. The function reference passed to this method will be executed
when a date cell ma... |
|
addYears(Number count ) : void |
DateMath |
Adds the designated number of years to the current calendar, and sets the current
calendar page date to the new month. |
|
after(Date date , Date compareTo ) : Boolean |
DateMath |
Determines whether a given date is after another date on the calendar. |
|
applyListeners() : void |
DateMath |
Applies the Calendar's DOM listeners to applicable elements. |
|
before(Date date , Date compareTo ) : Boolean |
DateMath |
Determines whether a given date is before another date on the calendar. |
|
between(Date date , Date dateBegin , Date dateEnd ) : Boolean |
DateMath |
Determines whether a given date is between two other dates on the calendar. |
|
buildDayLabel(Date workingDate ) : String |
DateMath |
Builds the date digit that will be displayed in calendar cells |
|
buildMonthLabel() : String |
DateMath |
Builds the date label that will be displayed in the calendar header or
footer, depending on configuration. |
|
buildWeekdays(Array html ) : Array |
DateMath |
Renders the Calendar's weekday headers. |
|
clear() : void |
DateMath |
Clears the selected dates in the current calendar widget and sets the calendar
to the current month and year. |
|
clearAllBodyCellStyles(style The ) : void |
DateMath |
Removes all styles from all body cells in the current calendar table. |
|
clearElement(HTMLTableCellElement The ) : void |
DateMath |
Clears the inner HTML, CSS class and style information from the specified cell. |
|
clearTime(Date date ) : Date |
DateMath |
Clears the time fields from a given date, effectively setting the time to midnight. |
|
configClose() : void |
DateMath |
Default handler for the "close" property |
|
configIframe() : void |
DateMath |
Renders the built-in IFRAME shim for the IE6 and below |
|
configLocale() : void |
DateMath |
The default handler for all configuration locale properties |
|
configLocaleValues() : void |
DateMath |
The default handler for all configuration locale field length properties |
|
configMaxDate() : void |
DateMath |
The default handler for the "maxdate" property |
|
configMinDate() : void |
DateMath |
The default handler for the "mindate" property |
|
configOptions() : void |
DateMath |
The default handler for all configuration options properties |
|
configPageDate() : void |
DateMath |
The default handler for the "pagedate" property |
|
configSelected() : void |
DateMath |
The default handler for the "selected" property |
|
configTitle() : void |
DateMath |
Default handler for the "title" property |
|
deselect(String/Date/Date[] date ) : Date[] |
DateMath |
Deselects a date or a collection of dates on the current calendar. This method, by default,
does not call the render ... |
|
deselectAll() : Date[] |
DateMath |
Deselects all dates on the current calendar. |
|
deselectCell(Number cellIndex ) : Date[] |
DateMath |
Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
This method ... |
|
doCellMouseOut(DOMEvent e , Calendar cal ) : void |
DateMath |
The event that is executed when the user moves the mouse out of a cell |
|
doCellMouseOver(DOMEvent e , Calendar cal ) : void |
DateMath |
The event that is executed when the user hovers over a cell |
|
doSelectCell(DOMEvent e , Calendar cal ) : void |
DateMath |
The default event function that is attached to a date link within a calendar cell
when the calendar is rendered. |
|
findMonthEnd(Date date ) : Date |
DateMath |
Gets the last day of a month containing a given date. |
|
findMonthStart(Date date ) : Date |
DateMath |
Gets the first day of a month containing a given date. |
|
getDateByCellId(String id ) : Date |
DateMath |
Retrieves the Date object for the specified Calendar cell |
|
getDateFieldsByCellId(String id ) : Array |
DateMath |
Retrieves the Date object for the specified Calendar cell |
|
getDayOffset(Date date , Number calendarYear ) : Number |
DateMath |
Calculates the number of days the specified date is from January 1 of the specified calendar year.
Passing January 1 ... |
|
getJan1(Number calendarYear ) : Date |
DateMath |
Retrieves a JavaScript Date object representing January 1 of any given year. |
|
getSelectedDates() : Date[] |
DateMath |
Gets the list of currently selected dates from the calendar. |
|
getWeekNumber(Date date , Number calendarYear , Number weekStartsOn ) : Number |
DateMath |
Calculates the week number for the given date. This function assumes that week 1 is the
week in which January 1 appea... |
|
hide() : void |
DateMath |
Hides the Calendar's outer container from view. |
|
init(String id , String containerId , Object config ) : void |
DateMath |
Initializes the Calendar widget. |
|
initEvents() : void |
DateMath |
Initializes Calendar's built-in CustomEvents |
|
initStyles() : void |
DateMath |
Defines the style constants for the Calendar |
|
isDateOOM(Date date ) : Boolean |
DateMath |
Determines whether a given date is OOM (out of month). |
|
isMonthOverlapWeek(Date weekBeginDate ) : Boolean |
DateMath |
Determines if a given week overlaps two different months. |
|
isYearOverlapWeek(Date weekBeginDate ) : Boolean |
DateMath |
Determines if a given week overlaps two different years. |
|
nextMonth() : void |
DateMath |
Navigates to the next month page in the calendar widget. |
|
nextYear() : void |
DateMath |
Navigates to the next year in the currently selected month in the calendar widget. |
|
onBeforeDeselect() : void |
DateMath |
Deprecated. Event executed before a date is deselected in the calendar widget. |
|
onBeforeSelect() : void |
DateMath |
Deprecated. Event executed before a date is selected in the calendar widget. |
|
onChangePage() : void |
DateMath |
Deprecated. Event executed when the user navigates to a different calendar page. |
|
onDeselect(Array selected ) : void |
DateMath |
Deprecated. Event executed when a date is deselected in the calendar widget. |
|
onRender() : void |
DateMath |
Deprecated. Event executed when the calendar widget is rendered. |
|
onSelect(Array selected ) : void |
DateMath |
Deprecated. Event executed when a date is selected in the calendar widget. |
|
previousMonth() : void |
DateMath |
Navigates to the previous month page in the calendar widget. |
|
previousYear() : void |
DateMath |
Navigates to the previous year in the currently selected month in the calendar widget. |
|
render() : void |
DateMath |
Deprecated. Event executed when the calendar widget is completely cleared to the current month with no selections. |
|
renderBody(Date workingDate , Array html ) : Array |
DateMath |
Renders the calendar body. |
|
renderBodyCellRestricted(Date workingDate , HTMLTableCellElement cell ) : String |
DateMath |
Renders the current calendar cell as a non-selectable "black-out" date using the default
restricted style. |
|
renderCellDefault(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Renders a single standard calendar cell in the calendar widget table.
All logic for determining how a standard defaul... |
|
renderCellNotThisMonth(Date workingDate , HTMLTableCellElement cell ) : String |
DateMath |
Applies the default style used for rendering dates that are not a part of the current
month (preceding or trailing th... |
|
renderCellStyleHighlight1(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Renders a single standard calendar cell using the CSS hightlight1 style |
|
renderCellStyleHighlight2(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Renders a single standard calendar cell using the CSS hightlight2 style |
|
renderCellStyleHighlight3(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Renders a single standard calendar cell using the CSS hightlight3 style |
|
renderCellStyleHighlight4(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Renders a single standard calendar cell using the CSS hightlight4 style |
|
renderCellStyleSelected(Date workingDate , HTMLTableCellElement cell ) : String |
DateMath |
Applies the default style used for rendering selected dates to the current calendar cell |
|
renderCellStyleToday(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Applies the default style used for rendering today's date to the current calendar cell |
|
renderFooter(Array html ) : Array |
DateMath |
Renders the calendar footer. In the default implementation, there is
no footer. |
|
renderHeader(Array html ) : Array |
DateMath |
Renders the calendar header. |
|
renderOutOfBoundsDate(Date workingDate , HTMLTableCellElement cell ) : String |
DateMath |
Renders a cell that falls before the minimum date or after the maximum date.
widget class. |
|
renderRowFooter(Number weekNum , Array cell ) : void |
DateMath |
Renders the row footer for a week. |
|
renderRowHeader(Number weekNum , Array cell ) : void |
DateMath |
Renders the row header for a week. |
|
reset() : void |
DateMath |
Resets the calendar widget to the originally selected month and year, and
sets the calendar to the initial selection(s). |
|
resetRenderers() : void |
DateMath |
Resets the render stack of the current calendar to its original pre-render value. |
|
select(String/Date/Date[] date ) : Date[] |
DateMath |
Selects a date or a collection of dates on the current calendar. This method, by default,
does not call the render me... |
|
selectCell(Number cellIndex ) : Date[] |
DateMath |
Selects a date on the current calendar by referencing the index of the cell that should be selected.
This method is u... |
|
setMonth(Number month ) : void |
DateMath |
Sets the calendar's month explicitly |
|
setYear(Number year ) : void |
DateMath |
Sets the calendar's year explicitly. |
|
show() : void |
DateMath |
Shows the Calendar's outer container. |
|
styleCellDefault(Date workingDate , HTMLTableCellElement cell ) : void |
DateMath |
Styles a selectable cell. |
|
subtract(Date date , Number field , Number amount ) : Date |
DateMath |
Subtracts the specified amount of time from the this instance. |
|
subtractMonths(Number count ) : void |
DateMath |
Subtracts the designated number of months from the current calendar month, and sets the current
calendar page date to... |
|
subtractYears(Number count ) : void |
DateMath |
Subtcats the designated number of years from the current calendar, and sets the current
calendar page date to the new... |
|
toString() : String |
DateMath |
Returns a string representation of the object. |
|
validate() : Should |
DateMath |
Validates the calendar widget. This method has no default implementation
and must be extended by subclassing the widget. |
CSS_CALENDAR
public Object CSS_CALENDAR
This property is defined by DateMath.
CSS_CELL
public Object CSS_CELL
This property is defined by DateMath.
CSS_CELL_BOTTOM
public Object CSS_CELL_BOTTOM
This property is defined by DateMath.
CSS_CELL_HIGHLIGHT1
public Object CSS_CELL_HIGHLIGHT1
This property is defined by DateMath.
CSS_CELL_HIGHLIGHT2
public Object CSS_CELL_HIGHLIGHT2
This property is defined by DateMath.
CSS_CELL_HIGHLIGHT3
public Object CSS_CELL_HIGHLIGHT3
This property is defined by DateMath.
CSS_CELL_HIGHLIGHT4
public Object CSS_CELL_HIGHLIGHT4
This property is defined by DateMath.
CSS_CELL_HOVER
public Object CSS_CELL_HOVER
This property is defined by DateMath.
CSS_CELL_LEFT
public Object CSS_CELL_LEFT
This property is defined by DateMath.
CSS_CELL_OOB
public Object CSS_CELL_OOB
This property is defined by DateMath.
CSS_CELL_OOM
public Object CSS_CELL_OOM
This property is defined by DateMath.
CSS_CELL_RESTRICTED
public Object CSS_CELL_RESTRICTED
This property is defined by DateMath.
CSS_CELL_RIGHT
public Object CSS_CELL_RIGHT
This property is defined by DateMath.
CSS_CELL_SELECTABLE
public Object CSS_CELL_SELECTABLE
This property is defined by DateMath.
CSS_CELL_SELECTED
public Object CSS_CELL_SELECTED
This property is defined by DateMath.
CSS_CELL_TODAY
public Object CSS_CELL_TODAY
This property is defined by DateMath.
CSS_CELL_TOP
public Object CSS_CELL_TOP
This property is defined by DateMath.
CSS_CONTAINER
public Object CSS_CONTAINER
This property is defined by DateMath.
CSS_FOOTER
public Object CSS_FOOTER
This property is defined by DateMath.
CSS_HEADER
public Object CSS_HEADER
This property is defined by DateMath.
CSS_HEADER_TEXT
public Object CSS_HEADER_TEXT
This property is defined by DateMath.
CSS_NAV_LEFT
public Object CSS_NAV_LEFT
This property is defined by DateMath.
CSS_NAV_RIGHT
public Object CSS_NAV_RIGHT
This property is defined by DateMath.
CSS_ROW_FOOTER
public Object CSS_ROW_FOOTER
This property is defined by DateMath.
CSS_ROW_HEADER
public Object CSS_ROW_HEADER
This property is defined by DateMath.
CSS_SINGLE
public Object CSS_SINGLE
This property is defined by DateMath.
CSS_WEEKDAY_CELL
public Object CSS_WEEKDAY_CELL
This property is defined by DateMath.
CSS_WEEKDAY_ROW
public Object CSS_WEEKDAY_ROW
This property is defined by DateMath.
DATE<static>
public String DATE<static>
<static> Type constant used for renderers to represent an individual date (M/D/Y)
This property is defined by DateMath.
DAY
public String DAY
<static> Constant field representing Day
This property is defined by DateMath.
DISPLAY_DAYS<static>
public Number DISPLAY_DAYS<static>
<static> Constant that represents the total number of date cells that are displayed in a given month
This property is defined by DateMath.
Locale
public Object Locale
The local object which contains the Calendar's locale settings
This property is defined by DateMath.
MONTH
public String MONTH
<static> Constant field representing Month
This property is defined by DateMath.
MONTH<static>
public String MONTH<static>
<static> Type constant used for renderers to represent a month across any year
This property is defined by DateMath.
MONTH_DAY<static>
public String MONTH_DAY<static>
<static> Type constant used for renderers to represent an individual date across any year (M/D)
This property is defined by DateMath.
ONE_DAY_MS
public Number ONE_DAY_MS
<static> Constant field representing one day, in milliseconds
This property is defined by DateMath.
Options
public Object Options
The local object which contains the Calendar's options
This property is defined by DateMath.
RANGE<static>
public String RANGE<static>
<static> Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y)
This property is defined by DateMath.
STOP_RENDER<static>
public String STOP_RENDER<static>
<static> Constant used for halting the execution of the remainder of the render stack
This property is defined by DateMath.
Style
public Object Style
Collection of Style constants for the Calendar
This property is defined by DateMath.
WEEK
public String WEEK
<static> Constant field representing Week
This property is defined by DateMath.
WEEKDAY<static>
public String WEEKDAY<static>
<static> Type constant used for renderers to represent a weekday
This property is defined by DateMath.
YEAR
public String YEAR
<static> Constant field representing Year
This property is defined by DateMath.
browser
public String browser
Returns a string representing the current browser.
This property is defined by DateMath.
cellDates
public Array[](Number[]) cellDates
The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].
This property is defined by DateMath.
cells
public HTMLTableCellElement[] cells
The collection of calendar table cells
This property is defined by DateMath.
cfg
public Number
@default cfg
The position of the year in a month/day/year date string
@config MDY_YEAR_POSITION
This property is defined by DateMath.
domEventMap
public Object domEventMap
A map of DOM event handlers to attach to cells associated with specific CSS class names
This property is defined by DateMath.
https
public String https
<static> The path to be used for images loaded for the Calendar
This property is defined by DateMath.
id
public String id
The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.
This property is defined by DateMath.
index
public Number index
The index of this item in the parent group
This property is defined by DateMath.
oDomContainer
public HTMLElement oDomContainer
The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered.
This property is defined by DateMath.
parent
public CalendarGroup parent
The parent CalendarGroup, only to be set explicitly by the parent group
This property is defined by DateMath.
renderStack
public Array[] renderStack
The list of render functions, along with required parameters, used to render cells.
This property is defined by DateMath.
today
public Date today
A Date object representing today's date.
This property is defined by DateMath.
add
public function add(Date date
, String field
, Number amount
)
Adds the specified amount of time to the this instance.
Parameters:
date
: DateThe JavaScript Date object to perform addition on
field
: StringThe field constant to be used for performing addition.
amount
: NumberThe number of units (measured in the field constant) to add to the date.
Returns:
This method is defined by DateMath.
addMonthRenderer
public function addMonthRenderer(Number month
, Function fnRender
)
Adds a month to the render stack. The function reference passed to this method will be executed
when a date cell matches the month passed to this method.
This method is defined by DateMath.
addMonths
public function addMonths(Number count
)
Adds the designated number of months to the current calendar month, and sets the current
calendar page date to the new month.
This method is defined by DateMath.
addRenderer
public function addRenderer(String sDates
, Function fnRender
)
Adds a renderer to the render stack. The function reference passed to this method will be executed
when a date cell matches the conditions specified in the date string for this renderer.
Parameters:
sDates
: StringA date string to associate with the specified renderer. Valid formats include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
fnRender
: FunctionThe function executed to render cells that match the render rules for this renderer.
Returns:
This method is defined by DateMath.
addWeekdayRenderer
public function addWeekdayRenderer(Number weekday
, Function fnRender
)
Adds a weekday to the render stack. The function reference passed to this method will be executed
when a date cell matches the weekday passed to this method.
This method is defined by DateMath.
addYears
public function addYears(Number count
)
Adds the designated number of years to the current calendar, and sets the current
calendar page date to the new month.
This method is defined by DateMath.
after
public function after(Date date
, Date compareTo
)
Determines whether a given date is after another date on the calendar.
This method is defined by DateMath.
applyListeners
public function applyListeners()
Applies the Calendar's DOM listeners to applicable elements.
This method is defined by DateMath.
before
public function before(Date date
, Date compareTo
)
Determines whether a given date is before another date on the calendar.
This method is defined by DateMath.
between
public function between(Date date
, Date dateBegin
, Date dateEnd
)
Determines whether a given date is between two other dates on the calendar.
Parameters:
date
: DateThe date to check for
dateBegin
: DateThe start of the range
dateEnd
: DateThe end of the range
Returns:
This method is defined by DateMath.
buildDayLabel
public function buildDayLabel(Date workingDate
)
Builds the date digit that will be displayed in calendar cells
Parameters:
workingDate
: DateThe current working date
Returns:
String
The formatted day label
This method is defined by DateMath.
buildMonthLabel
public function buildMonthLabel()
Builds the date label that will be displayed in the calendar header or
footer, depending on configuration.
This method is defined by DateMath.
buildWeekdays
public function buildWeekdays(Array html
)
Renders the Calendar's weekday headers.
This method is defined by DateMath.
clear
public function clear()
Clears the selected dates in the current calendar widget and sets the calendar
to the current month and year.
This method is defined by DateMath.
clearAllBodyCellStyles
public function clearAllBodyCellStyles(style The
)
Removes all styles from all body cells in the current calendar table.
This method is defined by DateMath.
clearElement
public function clearElement(HTMLTableCellElement The
)
Clears the inner HTML, CSS class and style information from the specified cell.
Parameters:
The
: HTMLTableCellElementcell to clear
Returns:
This method is defined by DateMath.
clearTime
public function clearTime(Date date
)
Clears the time fields from a given date, effectively setting the time to midnight.
This method is defined by DateMath.
configClose
public function configClose()
Default handler for the "close" property
This method is defined by DateMath.
configIframe
public function configIframe()
Renders the built-in IFRAME shim for the IE6 and below
This method is defined by DateMath.
configLocale
public function configLocale()
The default handler for all configuration locale properties
This method is defined by DateMath.
configLocaleValues
public function configLocaleValues()
The default handler for all configuration locale field length properties
This method is defined by DateMath.
configMaxDate
public function configMaxDate()
The default handler for the "maxdate" property
This method is defined by DateMath.
configMinDate
public function configMinDate()
The default handler for the "mindate" property
This method is defined by DateMath.
configOptions
public function configOptions()
The default handler for all configuration options properties
This method is defined by DateMath.
configPageDate
public function configPageDate()
The default handler for the "pagedate" property
This method is defined by DateMath.
configSelected
public function configSelected()
The default handler for the "selected" property
This method is defined by DateMath.
configTitle
public function configTitle()
Default handler for the "title" property
This method is defined by DateMath.
deselect
public function deselect(String/Date/Date[] date
)
Deselects a date or a collection of dates on the current calendar. This method, by default,
does not call the render method explicitly. Once deselection has completed, render must be
called for the changes to be reflected visually.
Parameters:
date
: String/Date/Date[]The date string of dates to deselect in the current calendar. Valid formats are individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006). Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005). This method can also take a JavaScript Date object or an array of Date objects.
Returns:
This method is defined by DateMath.
deselectAll
public function deselectAll()
Deselects all dates on the current calendar.
Parameters:
Returns:
Date[]
Array of JavaScript Date objects representing all individual dates that are currently selected. Assuming that this function executes properly, the return value should be an empty array. However, the empty array is returned for the sake of being able to check the selection status of the calendar.
This method is defined by DateMath.
deselectCell
public function deselectCell(Number cellIndex
)
Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
This method is used to easily deselect a single cell (usually with a mouse click) without having to do
a full render. The selected style is removed from the cell directly.
This method is defined by DateMath.
doCellMouseOut
public function doCellMouseOut(DOMEvent e
, Calendar cal
)
The event that is executed when the user moves the mouse out of a cell
This method is defined by DateMath.
doCellMouseOver
public function doCellMouseOver(DOMEvent e
, Calendar cal
)
The event that is executed when the user hovers over a cell
This method is defined by DateMath.
doSelectCell
public function doSelectCell(DOMEvent e
, Calendar cal
)
The default event function that is attached to a date link within a calendar cell
when the calendar is rendered.
This method is defined by DateMath.
findMonthEnd
public function findMonthEnd(Date date
)
Gets the last day of a month containing a given date.
This method is defined by DateMath.
findMonthStart
public function findMonthStart(Date date
)
Gets the first day of a month containing a given date.
This method is defined by DateMath.
getDateByCellId
public function getDateByCellId(String id
)
Retrieves the Date object for the specified Calendar cell
Parameters:
id
: StringThe id of the cell
Returns:
This method is defined by DateMath.
getDateFieldsByCellId
public function getDateFieldsByCellId(String id
)
Retrieves the Date object for the specified Calendar cell
Parameters:
id
: StringThe id of the cell
Returns:
This method is defined by DateMath.
getDayOffset
public function getDayOffset(Date date
, Number calendarYear
)
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.
This method is defined by DateMath.
getJan1
public function getJan1(Number calendarYear
)
Retrieves a JavaScript Date object representing January 1 of any given year.
This method is defined by DateMath.
getSelectedDates
public function getSelectedDates()
Gets the list of currently selected dates from the calendar.
This method is defined by DateMath.
getWeekNumber
public function getWeekNumber(Date date
, Number calendarYear
, Number weekStartsOn
)
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.
Parameters:
date
: DateThe JavaScript date for which to find the week number
calendarYear
: NumberOPTIONAL - The calendar year to use for determining the week number. Default is the calendar year of parameter "date".
weekStartsOn
: NumberOPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).
Returns:
This method is defined by DateMath.
hide
public function hide()
Hides the Calendar's outer container from view.
This method is defined by DateMath.
init
public function init(String id
, String containerId
, Object config
)
Initializes the Calendar widget.
Parameters:
id
: StringThe id of the table element that will represent the calendar widget
containerId
: StringThe id of the container div element that will wrap the calendar table
config
: ObjectThe configuration object containing the Calendar's arguments
Returns:
This method is defined by DateMath.
initEvents
public function initEvents()
Initializes Calendar's built-in CustomEvents
This method is defined by DateMath.
initStyles
public function initStyles()
Defines the style constants for the Calendar
This method is defined by DateMath.
isDateOOM
public function isDateOOM(Date date
)
Determines whether a given date is OOM (out of month).
Parameters:
Returns:
Boolean
true if the date is OOM
This method is defined by DateMath.
isMonthOverlapWeek
public function isMonthOverlapWeek(Date weekBeginDate
)
Determines if a given week overlaps two different months.
This method is defined by DateMath.
isYearOverlapWeek
public function isYearOverlapWeek(Date weekBeginDate
)
Determines if a given week overlaps two different years.
This method is defined by DateMath.
nextMonth
public function nextMonth()
Navigates to the next month page in the calendar widget.
This method is defined by DateMath.
nextYear
public function nextYear()
Navigates to the next year in the currently selected month in the calendar widget.
This method is defined by DateMath.
onBeforeDeselect
public function onBeforeDeselect()
Deprecated. Event executed before a date is deselected in the calendar widget.
This method is defined by DateMath.
onBeforeSelect
public function onBeforeSelect()
Deprecated. Event executed before a date is selected in the calendar widget.
This method is defined by DateMath.
onChangePage
public function onChangePage()
Deprecated. Event executed when the user navigates to a different calendar page.
This method is defined by DateMath.
onDeselect
public function onDeselect(Array selected
)
Deprecated. Event executed when a date is deselected in the calendar widget.
Parameters:
selected
: ArrayAn array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
Returns:
This method is defined by DateMath.
onRender
public function onRender()
Deprecated. Event executed when the calendar widget is rendered.
This method is defined by DateMath.
onSelect
public function onSelect(Array selected
)
Deprecated. Event executed when a date is selected in the calendar widget.
Parameters:
selected
: ArrayAn array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
Returns:
This method is defined by DateMath.
previousMonth
public function previousMonth()
Navigates to the previous month page in the calendar widget.
This method is defined by DateMath.
previousYear
public function previousYear()
Navigates to the previous year in the currently selected month in the calendar widget.
This method is defined by DateMath.
render
public function render()
Deprecated. Event executed when the calendar widget is completely cleared to the current month with no selections.
This method is defined by DateMath.
renderBody
public function renderBody(Date workingDate
, Array html
)
Renders the calendar body.
This method is defined by DateMath.
renderBodyCellRestricted
public function renderBodyCellRestricted(Date workingDate
, HTMLTableCellElement cell
)
Renders the current calendar cell as a non-selectable "black-out" date using the default
restricted style.
This method is defined by DateMath.
renderCellDefault
public function renderCellDefault(Date workingDate
, HTMLTableCellElement cell
)
Renders a single standard calendar cell in the calendar widget table.
All logic for determining how a standard default cell will be rendered is
encapsulated in this method, and must be accounted for when extending the
widget class.
This method is defined by DateMath.
renderCellNotThisMonth
public function renderCellNotThisMonth(Date workingDate
, HTMLTableCellElement cell
)
Applies the default style used for rendering dates that are not a part of the current
month (preceding or trailing the cells for the current month)
This method is defined by DateMath.
renderCellStyleHighlight1
public function renderCellStyleHighlight1(Date workingDate
, HTMLTableCellElement cell
)
Renders a single standard calendar cell using the CSS hightlight1 style
This method is defined by DateMath.
renderCellStyleHighlight2
public function renderCellStyleHighlight2(Date workingDate
, HTMLTableCellElement cell
)
Renders a single standard calendar cell using the CSS hightlight2 style
This method is defined by DateMath.
renderCellStyleHighlight3
public function renderCellStyleHighlight3(Date workingDate
, HTMLTableCellElement cell
)
Renders a single standard calendar cell using the CSS hightlight3 style
This method is defined by DateMath.
renderCellStyleHighlight4
public function renderCellStyleHighlight4(Date workingDate
, HTMLTableCellElement cell
)
Renders a single standard calendar cell using the CSS hightlight4 style
This method is defined by DateMath.
renderCellStyleSelected
public function renderCellStyleSelected(Date workingDate
, HTMLTableCellElement cell
)
Applies the default style used for rendering selected dates to the current calendar cell
This method is defined by DateMath.
renderCellStyleToday
public function renderCellStyleToday(Date workingDate
, HTMLTableCellElement cell
)
Applies the default style used for rendering today's date to the current calendar cell
This method is defined by DateMath.
renderFooter
public function renderFooter(Array html
)
Renders the calendar footer. In the default implementation, there is
no footer.
This method is defined by DateMath.
renderHeader
public function renderHeader(Array html
)
Renders the calendar header.
This method is defined by DateMath.
renderOutOfBoundsDate
public function renderOutOfBoundsDate(Date workingDate
, HTMLTableCellElement cell
)
Renders a cell that falls before the minimum date or after the maximum date.
widget class.
This method is defined by DateMath.
renderRowFooter
public function renderRowFooter(Number weekNum
, Array cell
)
Renders the row footer for a week.
This method is defined by DateMath.
renderRowHeader
public function renderRowHeader(Number weekNum
, Array cell
)
Renders the row header for a week.
This method is defined by DateMath.
reset
public function reset()
Resets the calendar widget to the originally selected month and year, and
sets the calendar to the initial selection(s).
This method is defined by DateMath.
resetRenderers
public function resetRenderers()
Resets the render stack of the current calendar to its original pre-render value.
This method is defined by DateMath.
select
public function select(String/Date/Date[] date
)
Selects a date or a collection of dates on the current calendar. This method, by default,
does not call the render method explicitly. Once selection has completed, render must be
called for the changes to be reflected visually.
Parameters:
date
: String/Date/Date[]The date string of dates to select in the current calendar. Valid formats are individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006). Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005). This method can also take a JavaScript Date object or an array of Date objects.
Returns:
This method is defined by DateMath.
selectCell
public function selectCell(Number cellIndex
)
Selects a date on the current calendar by referencing the index of the cell that should be selected.
This method is used to easily select a single cell (usually with a mouse click) without having to do
a full render. The selected style is applied to the cell directly.
This method is defined by DateMath.
setMonth
public function setMonth(Number month
)
Sets the calendar's month explicitly
This method is defined by DateMath.
setYear
public function setYear(Number year
)
Sets the calendar's year explicitly.
Parameters:
year
: NumberThe numeric 4-digit year
Returns:
This method is defined by DateMath.
show
public function show()
Shows the Calendar's outer container.
This method is defined by DateMath.
styleCellDefault
public function styleCellDefault(Date workingDate
, HTMLTableCellElement cell
)
Styles a selectable cell.
This method is defined by DateMath.
subtract
public function subtract(Date date
, Number field
, Number amount
)
Subtracts the specified amount of time from the this instance.
Parameters:
date
: DateThe JavaScript Date object to perform subtraction on
field
: NumberThe this field constant to be used for performing subtraction.
amount
: NumberThe number of units (measured in the field constant) to subtract from the date.
Returns:
This method is defined by DateMath.
subtractMonths
public function subtractMonths(Number count
)
Subtracts the designated number of months from the current calendar month, and sets the current
calendar page date to the new month.
This method is defined by DateMath.
subtractYears
public function subtractYears(Number count
)
Subtcats the designated number of years from the current calendar, and sets the current
calendar page date to the new month.
This method is defined by DateMath.
toString
public function toString()
Returns a string representation of the object.
This method is defined by DateMath.
validate
public function validate()
Validates the calendar widget. This method has no default implementation
and must be extended by subclassing the widget.
This method is defined by DateMath.