calendar Behavior

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Adds a calendar control to the document.

Syntax

XML
  	<Prefix:

CustomTag ID=sID STYLE="behavior:url('calendar.htc')" />

HTML <ELEMENT STYLE="behavior:url('calendar.htc')" ID=sID>
Scripting object.style.behavior = "url('calendar.htc')"
object.addBehavior ("calendar.htc")

Possible Values

Prefix Prefix that associates the CustomTag with an XML namespace. This prefix is set using the XMLNS attribute of the HTML tag.
CustomTag User-defined tag.
sID String that specifies a unique identifier for the object.

Members Table

The following table lists the members exposed by the calendar object.

Attribute Property Description
cal--currentMonth-background-color calCurrentMonthBackgroundColor Sets or retrieves the background color of the current month for the calendar behavior.
cal--currentMonth-color calCurrentMonthColor Sets or retrieves the color of the current month for the calendar behavior.
cal--currentMonth-font-family calCurrentMonthFontFamily Sets or retrieves the name of the font used for the active month cells in the calendar behavior.
cal--currentMonth-font-size calCurrentMonthFontSize Sets or retrieves the size of the font used for the current month in the calendar behavior.
cal--currentMonth-font-Weight calCurrentMonthFontWeight Sets or retrieves the weight of the font used for the current month in the calendar behavior.
cal--currentMonth-text-align calCurrentMonthTextAlign Sets or retrieves whether the text is left-aligned, right-aligned, centered, or justified for the current month in the calendar behavior.
cal--currentMonth-vertical-align calCurrentMonthVerticalAlign Sets or retrieves the vertical alignment of text in the cells of the current month for the calendar behavior.
cal--daytitle-background-color calDaytitleBackgroundColor Sets or retrieves the background color of the title field where the days of the week are listed for the calendar behavior.
cal--daytitle-color calDaytitleColor Sets or retrieves the color of the days of the week for the calendar behavior.
cal--daytitle-font-family calDaytitleFontFamily Sets or retrieves the name of the font used for the calendar behavior.
cal--daytitle-font-size calDaytitleFontSize Sets or retrieves the size of the font used for the names of the days of the week in the calendar behavior.
cal--daytitle-font-Weight calDaytitleFontWeight Sets or retrieves the weight of the font used for the names of the days of the week in the calendar behavior.
cal--daytitle-text-align calDaytitleTextAlign Sets or retrieves whether the text is left-aligned, right-aligned, centered, or justified for the calendar behavior.
cal--offMonth-background-color callOffMonthBackgroundColor Sets or retrieves the background color of the previous and next months for the calendar behavior.
cal--offMonth-color calOffMonthColor Sets or retrieves the color of the days of the week in the previous and next months for the calendar behavior.
cal--offMonth-font-family calOffMonthFontFamily Sets or retrieves the name of the font used in the previous and next month fields for the calendar behavior.
cal--offMonth-font-size calOffMonthFontSize Sets or retrieves the size of the font used for the calendar behavior.
cal--offMonth-font-weight calOffMonthFontWeight Sets or retrieves the weight of the font used for the previous and next months in the calendar behavior.
cal--offMonth-text-align calOffMonthTextAlign Sets or retrieves whether the text is left-aligned, right-aligned, centered, or justified for the calendar behavior.
cal--offMonth-vertical-align calOffMonthVerticalAlign Sets or retrieves the vertical alignment of text in the cells of the previous and next months for the calendar behavior.
cal--selectedDay-background-color calSelectedDayBackgroundColor Sets or retrieves the background color of the selected day for the calendar behavior.
cal--selectedDay-color calSelectedDayColor Sets or retrieves the color of the selected day for the calendar behavior.
cal--selectedDay-font-family calSelectedDayFontFamily Sets or retrieves the name of the font used for the selected day in the calendar behavior.
cal--selectedDay-font-size calSelectedDayFontSize Sets or retrieves the size of the font used for the selected day in the calendar behavior.
cal--selectedDay-font-weight calSelectedDayFontWeight Sets or retrieves the weight of the font used for the selected day in the calendar behavior.
cal--selectedDay-text-align calSelectedDayTextAlign Sets or retrieves whether the text is left-aligned, right-aligned, centered, or justified for the selected day in the calendar behavior.
cal--selectedDay-vertical-align calSelectedDayVerticalAlign Sets or retrieves the vertical alignment of text in the cells of the selected day for the calendar behavior.
cal--title-color calTitleColor Sets or retrieves the title color style for the calendar behavior.
cal--title-font-family calTitleFontFamily Sets or retrieves the name of the font used for the calendar behavior.
cal--title-font-size calTitleFontSize Sets or retrieves the size of the font used for the calendar behavior.
cal--title-font-Weight calTitleFontWeight Sets or retrieves the weight of the font used for the calendar behavior.
cal--title-text-align calTitleTextAlign Sets or retrieves whether the calendar title is left-aligned, right-aligned, centered, or justified for the calendar behavior.
DAY day Returns the selected day for the calendar behavior.
DAYLENGTH dayLength Sets or retrieves the length of the days for the calendar behavior.
FIRSTDAY firstDay Sets or retrieves the day of the week to display in the first column for the calendar behavior.
GRIDCELLEFFECT gridCellEffect Specifies how the grid lines are rendered for the calendar behavior.
GRIDLINESCOLOR gridLinesColor Specifies the color of the grid lines for the calendar behavior.
MONTH month Specifies the current month for the calendar behavior.
MONTHLENGTH monthLength Specifies the length of the month names for the calendar behavior.
READONLY readOnly Sets or retrieves whether the keyboard and mouse are disabled for the calendar behavior.
SHOWDATESELECTORS showDateSelectors Sets or retrieves whether the date selectors should be displayed for the calendar behavior.
SHOWDAYS showDays Sets or retrieves whether the days of the week should be displayed for the calendar behavior.
SHOWHORIZONTALGRID showHorizontalGrid Sets or retrieves whether horizontal grid lines are displayed for the calendar behavior.
SHOWTITLE showTitle Sets or retrieves whether the month and year are displayed as a title for the calendar behavior.
SHOWVERTICALGRID showVerticalGrid Sets or retrieves whether vertical grid lines are displayed for the calendar behavior.
VALUE value Sets or retrieves the current date for the calendar behavior.
VALUEISNULL valueIsNull Sets or retrieves whether the current date is selected for the calendar behavior.
YEAR year Sets or retrieves the current year for the calendar behavior.
Event Property Description
onpropertychange Fires when a property value is changed for the calendar behavior.

Remarks

The behavior-defined members listed in the preceding table are not accessible through script until the window. onload event fires. Waiting for this event to fire ensures that the document is completely loaded, that all behaviors have been applied to corresponding elements on the document , and, consequently, that all the behavior's properties, methods, and events are available for scripting. Attempting to use any of the behavior-defined members will result in a scripting error indicating that the object does not support that particular member.

The calendar behavior inserts a calendar control into a document . The calendar consists of three main sections:

  • The title area displays the month, year, and month and year list boxes.
  • Days of the week are ordered horizontally below the title area.
  • The individual days of the month, including overlapping days from the previous and following month, are contained in a grid below the days of the week.

The calendar.htc file can be downloaded from the calendar  sample page.

Example

This sample demonstrates the implementation and adjustments of the calendar behavior.

<HTML XMLNS:IE>
<HEAD>
<STYLE>
@media all{
   IE\:Calendar{
      behavior: url(/behaviors/calendar.htc) ;
      width : 33%;
   }
}
</STYLE>
</HEAD>
<BODY>
<IE:Calendar
   ID = "cal"
   STYLE = "width: 300; height: 275; border: '1px solid black';"
>
</IE:Calendar>
</BODY>
</HTML>

Code example: https://samples.msdn.microsoft.com/workshop/samples/author/behaviors/library/calendar/calendar.htm

See Also

Introduction to DHTML Behaviors, Using DHTML Behaviors