BiCalendar

This class represents a calendar control

This class extends BiComponent and therefore all methods and fields available for BiComponent are also available for BiCalendar .

Constructor

new BiCalendar ( [ oDate ] )

Parameters

Name Type Optional Default Descripton
oDate Date checked Optional javascript date object used to determine the month that should be displayed when the calendar is created.

Properties

Name Type get set Descripton
captionText String checked The text to show in the caption
currentDate Date checked checked The date describing the currently shown month. To get the selected date(s) use selectedDate(s)
dateFormatSymbols BiDateFormatSymbols checked checked The object providing the date picker with the symbols needed to display localized strings
maximum Date checked checked Getter for the maximum selectable date.
minimum Date checked checked Getter for the maximum selectable date.
scaleFonts Boolean checked checked Whether to resize the font in the day labels and days when calendar is resized.
selectedDate Date checked checked The selected date.
selectedDates Date[] checked checked These are the selected dates. In case multiple selection is used then use this instead of selectedDate
selectionModel BiCalendarSelectionModel checked This is the selection model used for the calendar
showCaption Boolean checked checked Whether to show the caption or not
showMonthButtons Boolean checked checked Whether to show the buttons that allow you to go to next or previous month in the caption
showYearButtons Boolean checked checked Whether to show the buttons that allow you to go to next or previous year in the caption

Methods

Name Description
goToMonth Goes to the given month. Note that months are numbered from 0 to 11 in Javascript.
goToToday Goes to today and selects that day
goToYear Goes to the given year
nextMonth Goes to the next month
nextYear Goes to the next year
previousMonth Goes to the previous month
previousYear Goes to the previous year
updateDateLabel This is called when the date label should be updated. Override this to add custom drawing of the label

Events

Name Type Bubbles Descripton
action BiEvent This event is fired when the user clicks on a day
change BiEvent This event is fired when the selection changes

Static Methods

Name Description
isSameDay This returns true if two dates represent the same day
isSameMonth This returns true if two dates represent the same month

Static Fields

None.

Remarks

Method Details

goToMonth

Goes to the given month. Note that months are numbered from 0 to 11 in Javascript.

Syntax

object.goToMonth
 (
 nMonth
 )
 

Parameters

Name Type Optional Default Descripton
nMonth Number The index of the month to go to

Return Type

void

goToToday

Goes to today and selects that day

Syntax

object.goToToday
 (
 
 )
 

Parameters

No arguments.

Return Type

void

goToYear

Goes to the given year

Syntax

object.goToYear
 (
 nFullYear
 )
 

Parameters

Name Type Optional Default Descripton
nFullYear Number The year to go to

Return Type

void

nextMonth

Goes to the next month

Syntax

object.nextMonth
 (
 
 )
 

Parameters

No arguments.

Return Type

void

nextYear

Goes to the next year

Syntax

object.nextYear
 (
 
 )
 

Parameters

No arguments.

Return Type

void

previousMonth

Goes to the previous month

Syntax

object.previousMonth
 (
 
 )
 

Parameters

No arguments.

Return Type

void

previousYear

Goes to the previous year

Syntax

object.previousYear
 (
 
 )
 

Parameters

No arguments.

Return Type

void

updateDateLabel

This is called when the date label should be updated. Override this to add custom drawing of the label

Syntax

object.updateDateLabel
 (
 oDate,oLabel
 )
 

Parameters

Name Type Optional Default Descripton
oDate Date The date object the label represents
oLabel BiLabel The label to update

Return Type

void

Static Method Details

isSameDay

This returns true if two dates represent the same day

Syntax

BiCalendar
 .
 isSameDay
 (
 d1,d2
 )
 

Parameters

Name Type Optional Default Descripton
d1 Date The first date to compare
d2 Date The second date to compare

Return Type

Boolean

isSameMonth

This returns true if two dates represent the same month

Syntax

BiCalendar
 .
 isSameMonth
 (
 d1,d2
 )
 

Parameters

Name Type Optional Default Descripton
d1 Date The first date to compare
d2 Date The second date to compare

Return Type

Boolean