Event class (Calendar)

Event(oEvents)

new Event(oEvents)

The Event object holds the event of the control. The Event(id) method returns the event based on its index or identifier/key.

Every option of the EventOptions type has associated a property of the Event object. For instance, the option:

cursor {string}, defines the mouse-cursor for the event
is associated with the property:
Cursor {string}, defines the mouse-cursor for the event
which means that the following statements are equivalent:
oEvent.Options = {cursor: "pointer"}
oEvent.SetOptions({cursor: "pointer"})
oEvent.Cursor = "pointer"
oEvent.SetCursor("pointer")
where oEvent is an object of Event type
Parameters:
Name Type Description
oEvents Event Indicates an object of Events type that's the owner collection of this event
Since:
  • 1.5
Event

Methods

GetCursor() → {string}

The GetCursor() method defines the mouse cursor for the event.
Returns:
Returns the mouse-cursor for the event.
Type
string
GetCursor

GetDate() → {any}

The GetDate() method defines the date of the event
Returns:
Returns the date of the event
Type
any
GetDate

GetIndex() → {any}

The GetIndex() method retrieves the event's index.
Returns:
Returns the event's index (0-based)
Type
any
Example
The following statements are equivalents:

 oEvent.GetIndex(), retrieves the event's index
 oEvent.Index, retrieves the event's index

where oEvent is an object of Event type
GetIndex

GetKey() → {string}

The GetKey() method returns the event's key.
Returns:
Returns the event's key
Type
string
GetKey

GetOptions() → {object}

The GetOptions() method returns the event's options at once
Returns:
Returns an object of EventOptions type
Type
object
Example
The following statements are equivalents:

 oEvent.GetOptions(), returns the event's options
 oEvent.Options, returns the event's options

where oEvent is an object of Event type
GetOptions

GetRepetitive() → {string}

The GetRepetitive() method defines the expression to define the repetitive-event
Returns:
Returns the expression to define the repetitive-event
Type
string
GetRepetitive

GetSelectable() → {boolean}

The GetSelectable() method determines whether the user can select the date
Returns:
Returns true if the user can select the date
Type
boolean
GetSelectable

GetShape() → {any}

The GetShape() method defines the shape for the event.
Returns:
Returns the shape for the event, as one of the following:
  • null, no custom-shape is applied on the object (default-shape may be applied instead)
  • the shape's name within the exontrol.Shape.Calendar or exontrol.Shape namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the event
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type
any
GetShape

GetToolTip() → {any}

The GetToolTip() method defines event's predefined tooltip
Returns:
Returns the event's predefined tooltip
Type
any
GetToolTip

GetUserData() → {any}

The GetUserData() method gets the extra-data associated with the event
Returns:
Returns the extra-data associated with the event
Type
any
GetUserData

Remove()

The Remove() method removes the event from the events collection
Remove

SetCursor(value)

The SetCursor() method changes the mouse cursor for the event.
Parameters:
Name Type Description
value any A string expression that defines the mouse cursor for the event.
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)
SetCursor

SetDate(value)

The SetDate() method sets the date of the event
Parameters:
Name Type Description
value any Specifies the date of the event, as explained: {null} or {undefined}, indicates the current date and time (equivalent of Date.Now()) {number}, indicates the Jan 1st of the year, such as "Jan 1st 2001" for 2001 {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#", such as "#10/10/2011 14:48#" or string-format as "YYYY-MM-DDTHH:mm:ss.sssZ" (ISO 8601), such as "2011-10-10" (date-only format), "2011-10-10T14:48:00" (local date-time format), "2011-10-10T14:48:00Z" (UTC date-time format), or "2011-10-10T14:48:00.000+09:00" (date-time format with milliseconds and time zone offset) {Date}, indicates a javascript Date to be copied, such as "Wed, 25 Mar 2015 15:00:00 GMT" for new Date("2015-03-25T15:00:00Z")
Example
null {null}, is equivalent of Date.Now()
 2001 {number}, is equivalent of Mon, 01 Jan 2001 00:00:00 GMT
 "#12/31/1971 13:00#" {string}, is equivalent of Fri, 31 Dec 1971 13:00:00 GMT
 new Date("2015-03-25T15:00:00Z"), is equivalent of Wed, 25 Mar 2015 15:00:00 GMT
SetDate

SetKey(value)

The SetKey() method assigns a new key to the event
Parameters:
Name Type Description
value string Specifies a new key to be assigned to the event
Example
"logo" {string}, defines the event with the giving key (logo). You can use the oCalendar.Event("logo") method to request the event giving its key.
SetKey

SetOptions(oOptions)

The SetOptions() method changes the event's options (visibility, caption, ...) at once
Parameters:
Name Type Description
oOptions object Specifies an object of EventOptions type that holds information about the event, such as caption, image and so on. If the oOptions parameter is not-of object type it indicates the event's caption instead
Example
oCalendar.Event(0).Options = {shape: "red", height: 32}, changes the event's height and background
 oCalendar.Event(0).SetOptions({shape: "red", height: 32}), changes the event's height and background
SetOptions

SetRepetitive(value)

The SetRepetitive() method sets the expression to define the repetitive-event
Parameters:
Name Type Description
value string Specifies the expression to define the repetitive-event. The Repetitive property supports Value or ICalendar format/expressions (requires "exontrol.icalendar.js"). The FREQ property determines whether the Repetitive property uses the Value or ICalendar format. In other words, if the Repetitive property contains the FREQ keyword, the ICalendar format is using, else the Value format.

The Value format supports the "value" keyword which defines the scheduling-date. The Value format/expressions supports constants, variables, operators, operations and predefined functions as described .

The ICalendar format (requires "exontrol.icalendar.js") supports RRULE expressions, as explained:

  • FREQ, {string} The FREQ rule part identifies the type of recurrence rule. This rule part MUST be specified in the recurrence rule. Valid values include SECONDLY, to specify repeating events based on an interval of a second or more; MINUTELY, to specify repeating events based on an interval of a minute or more; HOURLY, to specify repeating events based on an interval of an hour or more; DAILY, to specify repeating events based on an interval of a day or more; WEEKLY, to specify repeating events based on an interval of a week or more; MONTHLY, to specify repeating events based on an interval of a month or more; and YEARLY, to specify repeating events based on an interval of a year or more. The valid values are "SECONDLY", "MINUTELY", "HOURLY", "DAILY", "WEEKLY", "MONTHLY" and "YEARLY".
  • DTSTART {Date}, The DTSTART rule specifies the date the recurrence starts from, in YYYYMMDD[THHNNSS[Z]] format. If missing the current date and time is used.
  • INTERVAL {number}, The INTERVAL rule part contains a positive integer representing at which intervals the recurrence rule repeats. The default value is "1", meaning every second for a SECONDLY rule, every minute for a MINUTELY rule, every hour for an HOURLY rule, every day for a DAILY rule, every week for a WEEKLY rule, every month for a MONTHLY rule, and every year for a YEARLY rule. For example, within a DAILY rule, a value of "8" means every eight days.
  • COUNT {number}, The COUNT rule part defines the number of occurrences at which to range-bound the recurrence. The "DTSTART" property value always counts as the first occurrence.
  • WKST {string}, The WKST rule part specifies the day on which the workweek starts. Valid values are MO, TU, WE, TH, FR, SA, and SU. This is significant when a WEEKLY "RRULE" has an interval greater than 1, and a BYDAY rule part is specified. This is also significant when in a YEARLY "RRULE" when a BYWEEKNO rule part is specified. The default value is MO.
  • UNTIL {Date}, The UNTIL rule part defines a DATE or DATE-TIME value that bounds the recurrence rule in an inclusive manner. If the value specified by UNTIL is synchronized with the specified recurrence, this DATE or DATE-TIME becomes the last instance of the recurrence. The value of the UNTIL rule part MUST have the same value type as the "DTSTART" property.
  • BYWEEKNO {string}, The BYWEEKNO rule part specifies a COMMA-separated list of ordinals specifying weeks of the year. Valid values are 1 to 53 or -53 to -1.
  • BYDAY {string}, The BYDAY rule part specifies a COMMA-separated list of days of the week; SU indicates Sunday; MO indicates Monday; TU indicates Tuesday; WE indicates Wednesday; TH indicates Thursday; FR indicates Friday; and SA indicates Saturday.
  • BYMONTHDAY {string}, The BYMONTHDAY rule part specifies a COMMA-separated list of days of the month. Valid values are 1 to 31 or -31 to -1. For example, -10 represents the tenth to the last day of the month. The BYMONTHDAY rule part MUST NOT be specified when the FREQ rule part is set to WEEKLY.
  • BYYEARDAY {string}, The BYYEARDAY rule part specifies a COMMA-separated list of days of the year. Valid values are 1 to 366 or -366 to -1. For example, -1 represents the last day of the year (December 31st) and -306 represents the 306th to the last day of the year (March 1st). The BYYEARDAY rule part MUST NOT be specified when the FREQ rule part is set to DAILY, WEEKLY, or MONTHLY.
  • BYSETPOS {string}, The BYSETPOS rule part specifies a COMMA-separated list of values that corresponds to the nth occurrence within the set of recurrence instances specified by the rule. BYSETPOS operates on a set of recurrence instances in one interval of the recurrence rule. For example, in a WEEKLY rule, the interval would be one week A set of recurrence instances starts at the beginning of the interval defined by the FREQ rule part. Valid values are 1 to 366 or -366 to -1. It MUST only be used in conjunction with another BYxxx rule part. For example "the last work day of the month" could be represented as: FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1 Each BYSETPOS value can include a positive (+n) or negative (-n) integer. If present, this indicates the nth occurrence of the specific occurrence within the set of occurrences specified by the rule.
  • BYMONTH {string}, The BYMONTH rule part specifies a COMMA-separated list of months of the year. Valid values are 1 to 12.
  • BYHOUR {string}, The BYHOUR rule part specifies a COMMA-separated list of hours of the day. Valid values are 0 to 23. (ignored)
  • BYMINUTE {string}, The BYMINUTE rule part specifies a COMMA-separated list of minutes within an hour. Valid values are 0 to 59. (ignored)
  • BYSECOND {string}, The BYSECOND rule part specifies a COMMA-separated list of seconds within a minute. Valid values are 0 to 60. (ignored)

Example
Value format samples:

 "" {string} or null {null}, the event is not repetitive (no effect)
 "0" {string}, no occurrence
 "1" {string}, the event occurs every day
 "weekday(value) = 1" {string}, the event occurs every Monday
 "weekday(value) in (1,2) and month(value) = 6", the event occurs every Monday and Tuesday, on June only
 "value in (#6/8/2012#,#6/11/2012#,#6/20/2012#)", the event occurs on 6/8/2012, 6/11/2012 and 6/20/2012
 "value >= #6/1/2012# and ( (value - #6/1/2012#)/86400000 mod 5 = 0)", the event starts on 6/1/2012, and shows up every 5 days

 ICalendar format samples (requires "exontrol.icalendar.js"):

 "FREQ=DAILY", the event occurs daily
 "FREQ=MONTHLY", the event occurs monthly
 "FREQ=WEEKLY;BYDAY=MO,FR", the event occurs weekly every Monday and Friday
SetRepetitive

SetSelectable(value)

The SetSelectable() method specifies whether the user can select the date
Parameters:
Name Type Description
value boolean Indicates a boolean expression that specifies whether the user can select the date
Example
false {boolean}, the user can not select the date
 true {boolean}, the user can select the date
SetSelectable

SetShape(value)

The SetShape() method changes the shape for the event.
Parameters:
Name Type Description
value any The value could be any of the following:
  • null, no custom-shape is applied on the object (default-shape may be applied instead)
  • the shape's name within the exontrol.Shape.Calendar or exontrol.Shape namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the event
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Example
null {null}, no custom shape is applied (default object's shape may be applied)
 "" {string}, no custom shape is applied (no default object's shape is be applied)
 "red" {string}, fills the object's background in red (CSS color)
 '{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
 "xxx" {string}, indicates that exontrol.Shapes.Calendar.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
 exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace
SetShape

SetToolTip(value)

The SetToolTip() method sets the event's predefined tooltip.
Parameters:
Name Type Description
value any Specifies the event's predefined tooltip. The event's tooltip is shown once the cursor hovers the event. The value parameter supports ex-HTML format.
Example
null {null}, undefined {undefined} or "" {string}, no tooltip for the event is displayed
 "<img>image</img> and text" {string}, the image and text is being shown once the mouse pointer hovers the event. The image can be added using the exontrol.HTMLPicture.Add() method
SetToolTip

SetUserData(value)

The SetUserData() method associates any extra-data to the event
Parameters:
Name Type Description
value any Indicates any extra-data to associate to the event
SetUserData