The CalCell Object

Object that holds all data and code related to a calendar cell

Constructor

CalCell(owner,tableCell,dateObj,row,week)

The CalCell object's constructor. This function runs when a new instance of CalCell is created (i.e. cell = new CalCell(...)).

Arguments

  • Epoch owner
  • HTMLTableCell tableCell
  • Date dateObj
  • int row
  • int week

Return Values

(none)

Public Properties

cellClass

string CalCell::CellClass

Contains the current CSS class of the cell.

tableRow

int CalCell::tableRow

Contains the row index (0-4) of this cell's parent table row.

tableCell

HTMLTableCell CalCell::tableCell

Pointer to the table cell DOM element for this object instance.

date

Date CalCell::date

The JavaScript Date object associated with this calendar cell.

dayOfWeek

int {0-6} CallCell::dayOfWeek

The day of the week (0:Sunday to 6:Saturday) for this cell.

week

int CalCell::week

The week number of the cell.

Private Properties

self

CallCell CallCell::this

Pointer to the this construct of this object instance – used to work around varying meanings of this in different variable scopes in JavaScript. self behaves exactly the same as this would in other object-oriented languages such as C++ and PHP, and the two should be considered equivalent.

Public Methods

setClass()

Sets the CSS class of the cell based on this instance's property values.

Arguments

(none)

Return Values

(none)

setTitle(titleStr)

Sets the title (i.e. tooltip) that appears when a user holds their mouse cursor over a cell.

Arguments

  • string titleStr

Return Values

(none)

setURL(href, type)

Sets the URL for the current calendar cell.

Arguments

  • string href
  • string {'anchor','js'} type

Return Values

(none)

Usage

setURL() can be configured to create either a standard URL (activated if the user clicks the date), or as a JavaScript URL (activated if the user clicks any part of the cell). Use the type argument to specify which type of URL to use (default is standard URL).

Hint: using Epoch as a navigation tool can make navigating your site easier for your visitors – however, search engine robots will not be able to crawl links embedded in the calendar. We recommend offering standard HTML links as an alternative.

setHTML(html)

Sets the internal html of the cell, using a string containing html markup.

Arguments

  • Epoch owner
  • HTMLTableCell tableCell
  • Date dateObj
  • int row

Return Values

(none)

Private Methods

calCellonclick()

This function is called when the user clicks on this calendar cell. Any custom code that you want to run on click should go in this function code block.

Arguments

(none)

Return Values

(none)

calCellonmouseover()

Replicate the CSS:hover effect for non-supporting browsers – workaround for Internet Explorer's poor CSS:hover implementation.

Arguments

(none)

Return Values

(none)

calCellonmouseout()

Replicate the CSS:hover effect for non-supporting browsers – workaround for Internet Explorer's poor CSS:hover implementation.

Arguments

(none)

Return Values

(none)