public interface BBjCalendarWidget
BBjCalendarWidget
is a BBj Interface that serves as a plug-in to the
FullCalendar JavaScript-based calendar control.
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
THROW
n Error Codes:
500
: The calendar is not ready for interaction. Setting a callback for the
CalendarAPI.ON_CALENDAR_READY
event
will result in your application getting a CalendarReadyEvent
event signaling that the calendar is ready for interaction.510
: Invalid theme specified. The specified theme file does not exist.
See the getThemes()
method for more
information on installing and getting valid theme names.512
: Invalid parameter. The parameter provided to a method is null() or invalid. The error message may indicate which method call failed.514
: Invalid configuration. The specified object has not been configured correctly or is missing required properties.530
: Invalid date or time specified. The specified date or time string is not valid or cannot be parsed.700
: Missing file. The specified file does not exist. This may occur when the library attempts to read in an HTML, CSS, JavaScript, or theme file.Modifier and Type | Method and Description |
---|---|
void |
addEntries(BBjVector entries!)
Adds several entries of type
CalendarEntry to the calendar at once for improved performance. |
void |
addEntries(JsonArray entries!)
Adds several JsonObject entries in a JsonArray to the calendar at once for improved performance.
|
void |
addEntry(JsonObject entry!)
Adds an entry to the calendar given a JsonObject representation of the calendar entry.
|
void |
addEntrySource(CalendarEntrySource entrySource!)
Adds entries to the calendar from a
CalendarEntrySource . |
boolean |
addStyle(BBjString style!)
Adds the provided CSS style name to the widget.
|
void |
clearCallback(BBjNumber event!)
Removes the callback given the callback number.
|
void |
clearStyles()
Clears all the CSS styles from the widget.
|
void |
consoleLog(BBjString msg!)
Logs the provided string to the browser's console for debugging purposes regardless of whether the EnableDebug option has been set.
|
static BBjVector |
convertEntriesArrayToBBjVector(BBjString entries!)
A utility method that converts a stringified JSON array of calendar entries, such as what's received
from the JavaScript code, into a BBjVector filled with
CalendarEntry objects. |
static BBjVector |
convertEntriesArrayToBBjVector(JsonArray entries!)
A utility method that converts a JSON array of calendar entries, such as what's received from
the JavaScript code, into a BBjVector filled with CalendarEntry objects.
|
static JsonArray |
convertEntriesBBjVectorToJsonArray(BBjVector entries!)
A utility method that converts a BBjVector filled with
CalendarEntry object to a JSON array of calendar entries. |
void |
debugLog(BBjString msg!)
Logs a debug string to the browser's console for debugging purposes if the EnableDebug option has been set.
|
Object |
executeScript(BBjString script!)
Executes the provided JavaScript via the BBjJavaScriptExecutor class which results in a debounced execution, which
is useful when you don't need the return value from the script and the script can be batched with other scripts.
|
Object |
executeScriptImmediately(BBjString script!)
Executes the provided JavaScript immediately via the BBjJavaScriptExecutor class without debouncing, which
is necessary when you need the return value from the script.
|
BBjColor |
getBackColor()
Returns the background color of the calendar's containing window.
|
static JsonArray |
getBBjVectorAsJsonArray(BBjVector vector!)
A utility method that returns a JSON array version of the supplied BBjVector.
|
int |
getControlType()
Returns the unique control type for the
BBjCalendarWidget , which is 65050. |
BBjString |
getDate()
Returns the calendar's currently selected date.
|
BBjString |
getDateAsISOString()
Returns the calendar's currently selected date in ISO format.
|
BBjNumber |
getEnableDebug()
Returns whether the
BBjCalendarWidget should run in debug mode (1) or not (0). |
BBjVector |
getEntries()
Returns all of the calendar's entries as a BBjVector of
CalendarEntry objects. |
JsonArray |
getEntriesAsJsonArray()
Returns all of the calendar's entries as a JsonArray of JsonObject events.
|
BBjVector |
getEntriesWithTag(BBjString tag!)
Returns all of the calendar's entries as a BBjVector of
CalendarEntry objects. |
BBjVector |
getEntriesWithTags(BBjVector tags!)
Returns all of the calendar's entries as a BBjVector of
CalendarEntry objects. |
BBjVector |
getEntrySourceIds()
Returns a BBjVector filled with IDs for all the
CalendarEntrySource objects that have previously been added to the calendar via the addEntrySource() method. |
BBjString |
getEventDescription(BBjNumber eventNumber!)
A utility method that returns a descriptive string given an event number based on the
CalendarAPI.ON_CALENDAR_* callback constants. |
BBjNumber |
getHeight()
Returns the widget's height.
|
BBjVector |
getHiddenTags()
Returns a BBjVector filled with optional custom tags that were previously set with the setHiddenTags() method and determine which calendar entries should be hidden.
|
BBjHtmlView |
getHtmlView()
Returns the underlying BBjHtmlView control that contains the JavaScript FullCalendar.
|
BBjImage |
getImage()
Returns a BBjImage screenshot of the
BBjCalendarWidget . |
BBjNumber |
getIsReady()
Returns a BBjNumber acting as a boolean that indicates whether the widget is ready to be interacted with (1) or not (0).
|
static BBjVector |
getJsonArrayAsBBjVector(JsonArray array!)
A utility method that returns a BBjVector version of the supplied JSON array.
|
static BBjString |
getJsonObjectAsFormattedString(JsonObject json!)
A utility method that returns a formatted, or pretty-printed version of the supplied JSON object sorted alphabetically by key.
|
BBjNumber |
getLocalTimeZoneOffsetFromUtc()
Returns the difference between the client's local time and UTC in minutes.
|
String |
getName()
Returns the widget's name as previously-set via the
setName() method. |
CalendarOptions |
getOptions()
Returns the calendar's current options in an instance of the
CalendarOptions class. |
JsonObject |
getOptionsAsJsonObject()
Returns the calendar's options as a JsonObject.
|
BBjString |
getStyle(BBjString property!)
Returns the value of the specified CSS property.
|
BBjVector |
getStyles()
Returns the widget's name as previously-set via the
setName() method. |
static BBjVector |
getThemes()
Returns all of the calendar's available themes as an alphabetized list in a BBjVector filled with the theme names.
|
Object |
getUserData()
Returns the custom object that was previously associated with the widget by calling the
setUserData() method. |
BBjString |
getUuid()
Returns a unique auto-generated ID for the calendar instance that may be used to distinguish between instances of the class.
|
BBjString |
getValidDateString(BBjString dateString!)
Returns a date string formatted as YYYY-MM-DD if the provided date string can be parsed into a valid date, or null() if the date string is invalid.
|
BBjString |
getValidDateTimeString(BBjString dateTimeString!)
Returns an ISO 8601 formatted date/time string if the provided date/time string can be parsed into a valid date, or null() if it can't be parsed.
|
BBjString |
getValidTimeString(BBjString timeString!)
Returns a time string formatted as HH:MM:SS using 24-hour format if the provided time string can be parsed into a valid time, or null() if the time string is invalid.
|
BBjString |
getViewType()
Returns the calendar's view type which will be one of the following constants:
CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK() .
CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH() .
CalendarAPI.CALENDAR_VIEW_TIME_GRID_DAY() .
CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK() .
CalendarAPI.CALENDAR_VIEW_LIST_DAY() .
CalendarAPI.CALENDAR_VIEW_LIST_WEEK() .
CalendarAPI.CALENDAR_VIEW_LIST_MONTH() .
CalendarAPI.CALENDAR_VIEW_LIST_YEAR() .
|
BBjVector |
getVisibleTags()
Returns a BBjVector filled with optional custom tags that were previously set with the setVisibleTags() method and determine which calendar entries should be displayed.
|
BBjNumber |
getWidth()
Returns the widget's width.
|
BBjNumber |
getX()
Returns the widget's X coordinate, or horizontal position.
|
BBjNumber |
getY()
Returns the widget's Y coordinate, or vertical position.
|
void |
injectCss(BBjString css!)
Injects the provided CSS string into the
<head> element of the HTML document in the BBjHtmlView that contains the calendar. |
void |
injectCss(BBjString css!,
BBjString location!,
BBjString description!,
BBjNumber removePrevious!)
Injects the provided CSS string into the
head or body of the HTML DOM (as specified by the location! parameter)
in the BBjHtmlView that contains the calendar, as well as providing the ability to tag the CSS and replace it in subsequent calls. |
void |
injectCssFile(BBjString cssPath!)
Injects the CSS contained in the specified file into the
<head> element of the HTML document in the BBjHtmlView that contains the calendar. |
void |
injectScript(BBjString script!)
Injects the provided JavaScript string at the top-level window.
|
void |
injectScriptFile(BBjString scriptPath!)
Injects the JavaScript contained in the specified script file into the top-level window.
|
void |
injectUrl(BBjString url!)
Injects the specified JavaScript URL into the HTML DOM, making it available for subsequent use by client-side JavaScript.
|
boolean |
isEnabled()
Returns whether the widget is enabled or disabled.
|
boolean |
isVisible()
Returns whether the widget is visible or hidden.
|
void |
navigateDate(BBjString date!)
Navigates the calendar programmatically to the specified date.
|
void |
navigateNext()
Navigates the calendar programmatically one step forward (by a month or week for example),
and is the same as the user clicking on the 'next' toolbar button.
|
void |
navigateNextYear()
Navigates the calendar programmatically forward one year, and is the same as the user clicking on the 'nextYear' toolbar button.
|
void |
navigatePrev()
Navigates the calendar programmatically one step back (by a month or week for example),
and is the same as the user clicking on the 'prev' toolbar button.
|
void |
navigatePrevYear()
Navigates the calendar programmatically back one year, and is the same as the user clicking on the 'prevYear' toolbar button.
|
void |
navigateTime(BBjString time!)
Navigates the calendar programmatically to the specified time.
|
void |
navigateToday()
Navigates the calendar programmatically to the current date, and is the same as the user clicking on the 'today' toolbar button.
|
static BBjNumber |
ON_CALENDAR_DATE_CLICK()
Note that
ON_CALENDAR_DATE_CLICK event is not fired when the user clicks a day heading in a list view. |
static BBjNumber |
ON_CALENDAR_DATES_SET()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the calendar's date range has changed in any way. |
static BBjNumber |
ON_CALENDAR_DROP()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user dropped an external draggable element or an event from another calendar onto this calendar. |
static BBjNumber |
ON_CALENDAR_ENTRIES_SET()
If you set a callback for this event, then add several entries to the calendar, your callback routine may be flooded because the event will fire for every entry that you add.
|
static BBjNumber |
ON_CALENDAR_ENTRY_ADD()
Note: If you set a callback for this event, then add several events to the calendar, your callback routine may be flooded.
|
static BBjNumber |
ON_CALENDAR_ENTRY_CHANGE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the calendar's event data has changed in any way. |
static BBjNumber |
ON_CALENDAR_ENTRY_CLICK()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has clicked on a calendar's event. |
static BBjNumber |
ON_CALENDAR_ENTRY_DRAG_START()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has started dragging an event. |
static BBjNumber |
ON_CALENDAR_ENTRY_DRAG_STOP()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has stopped dragging an event. |
static BBjNumber |
ON_CALENDAR_ENTRY_DROP()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has dropped the event to a different day/time. |
static BBjNumber |
ON_CALENDAR_ENTRY_LEAVE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user is about to drop one of the calendar events on to another calendar. |
static BBjNumber |
ON_CALENDAR_ENTRY_MOUSE_ENTER()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user moved the mouse into the bounds of a calendar event. |
static BBjNumber |
ON_CALENDAR_ENTRY_MOUSE_LEAVE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user moved the mouse out of the bounds of a calendar event. |
static BBjNumber |
ON_CALENDAR_ENTRY_RECEIVE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the calendar has received an external draggable element with event data from another source or another calendar. |
static BBjNumber |
ON_CALENDAR_ENTRY_REMOVE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that an entry has been removed from the calendar. |
static BBjNumber |
ON_CALENDAR_ENTRY_RESIZE_START()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has started resizing an event. |
static BBjNumber |
ON_CALENDAR_ENTRY_RESIZE_STOP()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has stopped resizing an event. |
static BBjNumber |
ON_CALENDAR_ENTRY_RESIZE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the user has stopped resizing an event and the event has a different duration. |
static BBjNumber |
ON_CALENDAR_ENTRY_SOURCE_FAILURE()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that fetching a CalendarEntrySource failed. |
static BBjNumber |
ON_CALENDAR_ENTRY_SOURCE_SUCCESS()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that fetching a CalendarEntrySource succeeded. |
static BBjNumber |
ON_CALENDAR_READY()
A constant value that's used with the
BBjCalendarWidget::setCallback() method that signals that the BBjCalendarWidget is ready. |
static BBjNumber |
ON_CALENDAR_SELECT()
Note: You must configure the calendar to enable user selections via the
CalendarOptions:setEnableSelectable() method
if you intend to set a callback for the BBjCalendarWidget:ON_CALENDAR_SELECT or BBjCalendarWidget:ON_CALENDAR_UNSELECT events. |
static BBjNumber |
ON_CALENDAR_UNSELECT()
Note: You must configure the calendar to enable user selections via the
CalendarOptions:setEnableSelectable() method
if you intend to set a callback for the BBjCalendarWidget:ON_CALENDAR_SELECT or BBjCalendarWidget:ON_CALENDAR_UNSELECT events. |
static BBjNumber |
ON_CALENDAR_VIEW_CHANGE()
Note: This only fires when the type of view changes, not when the user changes the view from one subtype to another.
|
void |
onNativeEvent(BBjNativeJavaScriptEvent ev!)
An internal event handler for native JavaScript events from the BBjHtmlView control that converts a JavaScript calendar event to a BBj callback event.
|
void |
redraw(BBjNumber shouldCreate!)
Initially draws or redraws the widget whenever it needs to be rendered.
|
void |
refetchAllEntries()
Causes the calendar to refetch entries from all sources and rerender.
|
void |
refetchAllEntrySources()
Refetches all
CalendarEntrySource |
void |
refetchEntrySource(BBjString id!)
Refetches the
CalendarEntrySource |
BBjNumber |
removeAllEntries()
Removes all the entries in the calendar.
|
BBjNumber |
removeAllEntrySources()
Removes all
CalendarEntrySource |
BBjNumber |
removeEntries(BBjVector entries!)
Removes all the entries contained in the BBjVector from the calendar.
|
BBjNumber |
removeEntry(CalendarEntry entry!)
Removes an entry from the calendar.
|
BBjNumber |
removeEntryById(BBjString id!)
Removes an entry from the calendar given its optional unique ID which must have previously been set.
|
void |
removeEntrySource(BBjString id!)
Removes a
CalendarEntrySource |
boolean |
removeStyle(BBjString style!)
Removes the provided CSS style name from the widget.
|
void |
render()
Renders the calendar inside the HtmlView and applies the current calendar options.
|
void |
saveAsPngImage(BBjString path!)
Saves a BBjImage screenshot of the
BBjCalendarWidget to the specified file path. |
void |
setBackColor(BBjColor backColor!)
Sets the background color of the calendar's containing window.
|
void |
setCallback(BBjNumber event!,
BBjString callback!)
Registers a callback in a procedural program for the provided event type.
|
void |
setCallback(BBjNumber event!,
CustomObject instance!,
BBjString method!)
Registers a callback in an object-oriented program for the provided event type.
|
void |
setEnabled(boolean enabled!)
Sets whether the widget should be enabled.
|
void |
setEnableDebug(BBjNumber enableDebug)
Sets whether the
BBjCalendarWidget should run in debug mode (1) or not (0), where the default is 0. |
void |
setHiddenTags(BBjString tags!)
Sets one or more optional, custom tags that determine which calendar
entries should be hidden.
|
void |
setHiddenTags(BBjVector tags!)
Sets one or more optional, custom tags that determine which calendar
entries should be hidden.
|
void |
setLocation(BBjNumber x!,
BBjNumber y!)
Sets the location of the calendar widget given the provided X and Y coordinates.
|
void |
setName(BBjString name!)
Sets the widget's name, which can later be retrieved via the
getName() method. |
void |
setOptions(CalendarOptions options!)
Sets the calendar's options given an instance of the
CalendarOptions class. |
void |
setPadding(BBjNumber padding!)
Sets the padding, or spacing around the calendar control, to the same number of pixels for all four sides.
|
void |
setPadding(BBjNumber paddingTop!,
BBjNumber paddingRight!,
BBjNumber paddingBottom!,
BBjNumber paddingLeft!)
Sets the padding, or spacing around the calendar control, to the specified number of pixels for the top, right, bottom, and left sides.
|
void |
setSize(BBjNumber width!,
BBjNumber height!)
Sets the size of the calendar widget given the provided width and height.
|
void |
setStyle(BBjString property!,
BBjString style!)
Sets a CSS property on the widget.
|
void |
setTheme(BBjString theme!)
Sets the calendar's theme to one of the installed Boostrap themes, which modifies the calendar's fonts and color scheme.
|
void |
setUserData(Object userData!)
Sets a custom, arbitrary object to be associated with the widget which can be retrieved later via the
getUserData() method. |
void |
setViewType(BBjString viewType!)
Sets the calendar's view type.
|
void |
setVisible(boolean visible!)
Sets whether the widget should be visible or hidden.
|
void |
setVisibleTags(BBjString tags!)
Sets one or more optional, custom tags that determine which calendar
entries should be displayed.
|
void |
setVisibleTags(BBjVector tags!)
Sets one or more optional, custom tags that determine which calendar
entries should be displayed.
|
void |
suppressBuiDebouncing(BBjNumber suppress!)
Supresses JavaScript debouncing for BUI.
|
void |
suppressDebouncing(BBjNumber suppress!)
Supressesss JavaScript debouncing for both GUI and BUI.
|
void |
suppressGuiDebouncing(BBjNumber suppress!)
Supresses JavaScript debouncing when running in GUI.
|
void |
updateEntries(BBjVector entries!)
Updates several entries of type
CalendarEntry to the calendar at once for improved performance. |
void |
updateEntries(JsonArray entries!)
Updates several JsonObject entries in a JsonArray to the calendar at once for improved performance.
|
void |
updateEntry(CalendarEntry entry!)
Updates an entry in the calendar.
|
void |
updateSize()
Forces the calendar to resize itself based on the available space in the container DIV.
|
static BBjNumber ON_CALENDAR_READY()
BBjCalendarWidget::setCallback()
method that signals that the BBjCalendarWidget
is ready.
Setting a callback for this event type will result in your application getting a CalendarReadyEvent
object.
static BBjNumber ON_CALENDAR_VIEW_CHANGE()
Note: This only fires when the type of view changes, not when the user changes the view from one subtype to another. For example,
the event will be triggered when the user switches from the
CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()
to the
CalendarAPI.CALENDAR_VIEW_LIST_MONTH()
view. But it won't be triggerd when the user changes from
CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()
to
CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK()
since both views are
the same type (dayGrid) and just the subtype (week vs. month) changes.
static BBjNumber ON_CALENDAR_ENTRIES_SET()
When responding to this event, the BBjAPI().getLastEvent()
call
will return a CalendarEntriesSetEvent
object.
You can call the CalendarEntriesSetEvent::getEntries()
method to return a BBjVector of
CalendarEntry
objects that corresponds to all the known entries in the calendar at that instant in time.
Setting a callback for this event type will result in your application getting a CalendarEntriesSetEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_CLICK()
BBjCalendarWidget::setCallback()
method that signals that the user has clicked on a calendar's event.
Setting a callback for this event type will result in your application getting a CalendarEntryClickEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_ADD()
Note: If you set a callback for this event, then add several events to the calendar, your callback routine may be flooded.
Setting a callback for this event type will result in your application getting a CalendarEntryAddEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_CHANGE()
BBjCalendarWidget::setCallback()
method that signals that the calendar's event data has changed in any way.
Setting a callback for this event type will result in your application getting a CalendarEntryChangeEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_REMOVE()
BBjCalendarWidget::setCallback()
method that signals that an entry has been removed from the calendar.
If you set a callback for this event, then remove several entries from the calendar, your callback routine may be flooded because
the event will fire for every entry that was removed.
Setting a callback for this event type will result in your application getting a CalendarEntryRemoveEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_MOUSE_ENTER()
BBjCalendarWidget::setCallback()
method that signals that the user moved the mouse into the bounds of a calendar event.
Setting a callback for this event type will result in your application getting a CalendarEntryMouseEnterEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_MOUSE_LEAVE()
BBjCalendarWidget::setCallback()
method that signals that the user moved the mouse out of the bounds of a calendar event.
Setting a callback for this event type will result in your application getting a CalendarEntryMouseLeaveEvent
object.
static BBjNumber ON_CALENDAR_ENTRY_DRAG_START()
BBjCalendarWidget::setCallback()
method that signals that the user has started dragging an event.static BBjNumber ON_CALENDAR_ENTRY_DRAG_STOP()
BBjCalendarWidget::setCallback()
method that signals that the user has stopped dragging an event.static BBjNumber ON_CALENDAR_ENTRY_RESIZE_START()
BBjCalendarWidget::setCallback()
method that signals that the user has started resizing an event.static BBjNumber ON_CALENDAR_ENTRY_RESIZE_STOP()
BBjCalendarWidget::setCallback()
method that signals that the user has stopped resizing an event.static BBjNumber ON_CALENDAR_ENTRY_RESIZE()
BBjCalendarWidget::setCallback()
method that signals that the user has stopped resizing an event and the event has a different duration.static BBjNumber ON_CALENDAR_ENTRY_DROP()
BBjCalendarWidget::setCallback()
method that signals that the user has dropped the event to a different day/time.static BBjNumber ON_CALENDAR_ENTRY_RECEIVE()
BBjCalendarWidget::setCallback()
method that signals that the calendar has received an external draggable element with event data from another source or another calendar.static BBjNumber ON_CALENDAR_ENTRY_LEAVE()
BBjCalendarWidget::setCallback()
method that signals that the user is about to drop one of the calendar events on to another calendar.static BBjNumber ON_CALENDAR_ENTRY_SOURCE_SUCCESS()
BBjCalendarWidget::setCallback()
method that signals that fetching a CalendarEntrySource
succeeded.static BBjNumber ON_CALENDAR_ENTRY_SOURCE_FAILURE()
BBjCalendarWidget::setCallback()
method that signals that fetching a CalendarEntrySource
failed.static BBjNumber ON_CALENDAR_DATES_SET()
BBjCalendarWidget::setCallback()
method that signals that the calendar's date range has changed in any way.
Setting a callback for this event type will result in your application getting a CalendarDatesSetEvent
object.
static BBjNumber ON_CALENDAR_DATE_CLICK()
Note that ON_CALENDAR_DATE_CLICK
event is not fired when the user clicks a day heading in a list view.
Setting a callback for this event type will result in your application getting a CalendarDateClickEvent
object.
static BBjNumber ON_CALENDAR_SELECT()
Note: You must configure the calendar to enable user selections via the CalendarOptions:setEnableSelectable()
method
if you intend to set a callback for the BBjCalendarWidget:ON_CALENDAR_SELECT
or BBjCalendarWidget:ON_CALENDAR_UNSELECT
events.
Setting a callback for this event type will result in your application getting a CalendarSelectEvent
object.
static BBjNumber ON_CALENDAR_UNSELECT()
Note: You must configure the calendar to enable user selections via the CalendarOptions:setEnableSelectable()
method
if you intend to set a callback for the BBjCalendarWidget:ON_CALENDAR_SELECT
or BBjCalendarWidget:ON_CALENDAR_UNSELECT
events.
A selection might be cleared for a number of reasons:
The CalendarOptions::setEnableUnselectAuto()
impacts what causes the BBjCalendarWidget.ON_CALENDAR_UNSELECT
event to be fired.
If automatic unselection is enabled, then the unselection event will typically be fired after the user releases their selection mouse button.
Setting a callback for this event type will result in your application getting a CalendarUnselectEvent
.
static BBjNumber ON_CALENDAR_DROP()
BBjCalendarWidget::setCallback()
method that signals that the user dropped an external draggable element or an event from another calendar onto this calendar.BBjString getUuid()
BBjHtmlView getHtmlView()
BBjNumber getIsReady()
void setEnableDebug(BBjNumber enableDebug)
BBjCalendarWidget
should run in debug mode (1) or not (0), where the default is 0.
When this is set to true (1), the BBjCalendarWidget
will:
!CHROMIUM_SWITCHES
global string entry is properly set before instantiating the BBjCalendarWidget
, as in: chromium_switches$ = stbl("!CHROMIUM_SWITCHES", "--remote-debugging-port = 9223")
BBjNumber
- enableDebug A BBjNumber acting as a boolean that determines whether the BBjCalendarWidget
should run in debug mode (1) or not (0).BBjNumber getEnableDebug()
BBjCalendarWidget
should run in debug mode (1) or not (0).BBjCalendarWidget
is running in debug mode.void setOptions(CalendarOptions options!)
CalendarOptions
class.
Note: After setting the calendar's options inline (see example #1 below), you will need to call the calendar's render()
method to apply the changes to the calendar in order for them to take effect.
There are a couple of ways to set options for the calendar: 1) Get and then set the desired options inline dynamically, calling the render() method afterwards to force the calendar to update with the new configuration:
2) Get the options instance, call setter methods on it, then use it to set the calendar's options:
rem Get and then set the desired options inline dynamically, calling the render() method afterwards to force the calendar to update with the new configuration: myCal!.getOptions().setEnableEntryDurationEditable(1) myCal!.getOptions().setEnableEntryResizableFromStart(1) myCal!.getOptions().setEnableEntryStartEditable(1) myCal!.getOptions().setEnableSlotEntryOverlap(0) myCal!.render()
rem Get the calendar's options object, then call the desired set methods, then apply the updated options to the calendar: opts! = myCal!.getOptions() opts!.setEnableEntryDurationEditable(1) opts!.setEnableEntryResizableFromStart(1) opts!.setEnableEntryStartEditable(1) opts!.setEnableSlotEntryOverlap(0) myCal!.setOptions(opts!)
CalendarOptions
- options! An instance of the CalendarOptions
class that has been configured with the desired settings.CalendarOptions getOptions()
CalendarOptions
class.void injectCss(BBjString css!)
<head>
element of the HTML document in the BBjHtmlView that contains the calendar.
This method provides a simple way to add custom CSS that affects the calendar. For more advanced use cases, see the
injectCss()
method that takes several
parameters to provide greater control over the injection.
BBjString
- css! The CSS to inject into the BBjHtmlView's DOM.void injectCss(BBjString css!, BBjString location!, BBjString description!, BBjNumber removePrevious!)
head
or body
of the HTML DOM (as specified by the location! parameter)
in the BBjHtmlView that contains the calendar, as well as providing the ability to tag the CSS and replace it in subsequent calls.BBjString
- css! The CSS to inject into the BBjHtmlView's DOM.BBjString
- location! The target for injection which can be 'head' or 'body'. If it's an empty string, it will default to 'body'.BBjString
- description! The description of the CSS, which is used to replace it in subsequent calls.BBjNumber
- removePrevious! A BBjNumber acting as a boolean that determines whether the CSS should replace existing CSS with the same description.void injectCssFile(BBjString cssPath!)
<head>
element of the HTML document in the BBjHtmlView that contains the calendar.
This is a convenience method that reads in the contents of the provided CSS file and injects it into the HtmlView control that contains the calendar.BBjString
- cssPath! A string representing the full path and filename of the file that contains the CSS to be injected.void injectScript(BBjString script!)
BBjString
- script! The JavaScript to inject into the BBjHtmlView.void injectScriptFile(BBjString scriptPath!)
BBjString
- scriptPath! A string representing the full path and filename of the file that contains the JavaScript to be injected.void injectUrl(BBjString url!)
BBjString
- url! The URL string containing JavaScript to be injected into the HTML DOM.Object executeScript(BBjString script!)
executeScriptImmediately()
method instead.
Note: The executor handles JSNI automatically so you don't have to check for BUI and adjust the window and document JavaScript objects. If the BBjHtmlView is not ready yet then the script will be queued. After the BBjHtmlView control is ready then the executor will execute it on the client.
BBjString
- script$ The JavaScript code to execute.Object executeScriptImmediately(BBjString script!)
Note: The executor handles JSNI automatically so you don't have to check for BUI and adjust the window and document JavaScript objects.
If the BBjHtmlView is not ready then this method will throw an error 500. Setting a callback for the
CalendarAPI.ON_CALENDAR_READY
will result in your application getting a CalendarReadyEvent
event signaling that the calendar is ready for interaction.
BBjString
- script$ The JavaScript code to execute.void suppressBuiDebouncing(BBjNumber suppress!)
Setting this to "0" may help to improve the communication performance between BBj and the calendar in the BBjHtmlViewControl when running in BUI.
BBjNumber
- suppress! A BBjNumber acting as a boolean that determines whether the BBjJavaScriptExecutor should disable debouncing or not where 1 = suppressDebouncing and 0 = doNotSuppressDebouncing (default).void suppressGuiDebouncing(BBjNumber suppress!)
Setting this to "0" may help to improve the communication performance between BBj and the calendar in the BBjHtmlViewControl when running in GUI.
BBjNumber
- suppress! A BBjNumber acting as a boolean that determines whether the BBjJavaScriptExecutor should disable debouncing or not where 1 = suppressDebouncing and 0 = doNotSuppressDebouncing (default).void suppressDebouncing(BBjNumber suppress!)
BBjNumber
- suppress! A BBjNumber acting as a boolean that determines whether the BBjJavaScriptExecutor should disable debouncing or not where 1 = suppressDebouncing and 0 = doNotSuppressDebouncing (default).void render()
This composes the calendar configuration and sends it to the client for a full rerendering. This is the
difference between the render()
and the redraw()
method - the redraw()
method
only instructs the calendar to repaint itself; it doesn't change or apply any configuration options.
You can call this method to force the calendar to be updated after you modify its setup configuration, as in:
Note: You don't have to call the
rem Get and then set the desired options inline dynamically, calling the render() method afterwards to force the calendar to update with the new configuration: myCal!.getOptions().setEnableEntryDurationEditable(1) myCal!.getOptions().setEnableEntryResizableFromStart(1) myCal!.getOptions().setEnableEntryStartEditable(1) myCal!.getOptions().setEnableSlotEntryOverlap(0) myCal!.render()
render()
method if you update the calendar's configuration via the setOptions()
method.void refetchAllEntries()
If you've previously added events to the calendar from a remote source, such as a web service or Google Calendar, then the calendar will requery those sources for an updated entry set. If the entries on the backend have changed, such as some entries have been added and others deleted, then those changes will be reflected on the calendar after calling this method.
void debugLog(BBjString msg!)
consoleLog()
method instead.
If you provide a simple string, like
"Got Here!
"
then you'll see an entry in the console that looks like
"BBjCalendarWidget Debug: Got Here!
"
Note: If you provide a static string with single quotes, then you can print out JavaScript objects if they're not enclosed in the single quotes. For example, calling the method with the string
"'Calendar View: ', window.calendar.view.type
"
(note the single quotes) results in the following message being printed in the console:
"BBjCalendarWidget Debug: Calendar View: timeGridWeek
".
In other words, if you supply single quotes then the entire parameter is applied to the console.log()
JavaScript function without any modifications.
void consoleLog(BBjString msg!)
If you provide a simple string, like
"Got Here!
"
then you'll see an entry in the console that looks like
"BBjCalendarWidget Debug: Got Here!
"
Note: If you provide a static string with single quotes, then you can print out JavaScript objects if they're not enclosed in the single quotes. For example, calling the method with the string
"'Calendar View: ', window.calendar.view.type
"
(note the single quotes) results in the following message being printed in the console:
"BBjCalendarWidget Debug: Calendar View: timeGridWeek
".
In other words, if you supply single quotes then the entire parameter is applied to the console.log()
JavaScript function without any modifications.
void onNativeEvent(BBjNativeJavaScriptEvent ev!)
BBjNativeJavaScriptEvent
- ev! The Javascript event from the client.void redraw(BBjNumber shouldCreate!)
Your application code won't ever have to call this method under normal conditions. It's typically only used internally
to redraw the calendar after the the setSize()
method has been called. However, if you may want to call
the render()
method if you modified the calendar's options inline (as opposed to using the setOptions()
method.
BBjNumber
- shouldCreate! A BBjNumber acting as a boolean that indicates if the control should be (re)created (1) or just redrawn (0).JsonObject getOptionsAsJsonObject()
void updateSize()
Using the default index.html template, the calendar is contained within the DIV that has the class 'BBjCalendarWidgetContainer'. Whenever you modify the container DIV in such a way that it affects the calendar's size, such as dynamically changing its margin CSS, you may want to call this method afterwards to cause the calendar to adjust to the new container size.
Note: If you call one of the setPadding() methods then this will be executed automatically after the padding has been added to the container DIV, so this method isn't likely to be needed very often.
void setPadding(BBjNumber padding!)
Using the default index.html template, the calendar is contained within the DIV that has the class 'BBjCalendarWidgetContainer'. This method modifies the CSS for the container DIV by setting its padding to the provided padding size in pixels.
BBjNumber
- padding! The numeric value of the desired padding in pixels, e.g. '5' for a 5-pixel padding on all sides.void setPadding(BBjNumber paddingTop!, BBjNumber paddingRight!, BBjNumber paddingBottom!, BBjNumber paddingLeft!)
Using the default index.html template, the calendar is contained within the DIV that has the class 'BBjCalendarWidgetContainer'. This method modifies the CSS for the container DIV by setting its padding to the provided padding size in pixels.
BBjNumber
- paddingTop! The numeric value of the desired top padding in pixels, e.g. '5' for a 5-pixel padding on the top of the container.BBjNumber
- paddingRight! The numeric value of the desired right padding in pixels, e.g. '5' for a 5-pixel padding on the right side of the container.BBjNumber
- paddingBottom! The numeric value of the desired bottom padding in pixels, e.g. '5' for a 5-pixel padding on the bottom of the container.BBjNumber
- paddingLeft! The numeric value of the desired left in pixels, e.g. '5' for a 5-pixel padding on the left side of the container.int getControlType()
BBjCalendarWidget
, which is 65050.BBjImage getImage()
BBjCalendarWidget
.void saveAsPngImage(BBjString path!)
BBjCalendarWidget
to the specified file path.BBjString
- path! A string representing the full path and filename for the saved screenshot of the calendar.BBjVector getVisibleTags()
When dealing with entry tags, there are three sets to be aware of:
CalendarEntry
custom class offers setTags() methods that give you the opportunity to add custom tags to any entry.BBjCalendarWidget::setVisibleTags()
methods allow you to set which entries will be visible in the calendar, as any entries that share a tag with the visible tag set will be displayed normally.BBjCalendarWidget::setHiddenTags()
methods allow you to set which entries will be hidden in the calendar, as any entries that share a tag with the hidden tag set will be be hidden from view.
Note: If the BBjCalendarWidget
's set of visible tags is empty then all calendar entries will be visible.
If the BBjCalendarWidget
's set of hidden tags is empty then all calendar entries will be visible.
Note: You will typically affect the calendar's entry visibility by calling either the setVisibleTags() or setHiddenTags() methods, but not both.
BBjCalendarWidget::setVisibleTags()
methods.void setVisibleTags(BBjString tags!)
CalendarEntry
custom class offers
setTags() methods that give you the opportunity to add custom tags to any entry. After
adding tags to one or more entries, you can call methods on the calendar to show or
hide entries based on their tags by calling the BBjCalendarWidget::setVisibleTags()
and
BBjCalendarWidget::setHiddenTags()
methods.
This is similar to the setVisibleTags()
method that takes a BBjVector except that it takes a comma-delimted string of tags for succinctness.
BBjString
- tags! A comma-delimted string of tags such as "work, programming".void setVisibleTags(BBjVector tags!)
CalendarEntry
custom class offers
setTags() methods that give you the opportunity to add custom tags to any entry. After
adding tags to one or more entries, you can call methods on the calendar to show or
hide entries based on their tags by calling the BBjCalendarWidget::setVisibleTags()
and
BBjCalendarWidget::setHiddenTags()
methods.BBjVector
- A vector filled with tags such as "work", "programming", "meeting", etc.BBjVector getHiddenTags()
When dealing with entry tags, there are three sets to be aware of:
CalendarEntry
custom class offers setTags() methods that give you the opportunity to add custom tags to any entry.BBjCalendarWidget::setVisibleTags()
methods allow you to set which entries will be visible in the calendar, as any entries that share a tag with the visible tag set will be displayed normally.BBjCalendarWidget::setHiddenTags()
methods allow you to set which entries will be hidden in the calendar, as any entries that share a tag with the hidden tag set will be be hidden from view.
Note: If the BBjCalendarWidget
's set of visible tags is empty then all calendar entries will be visible.
If the BBjCalendarWidget
's set of hidden tags is empty then all calendar entries will be visible.
Note: You will typically affect the calendar's entry visibility by calling either the setVisibleTags() or setHiddenTags() methods, but not both.
BBjCalendarWidget::setVisibleTags()
methods.void setHiddenTags(BBjString tags!)
CalendarEntry
custom class offers
setTags() methods that give you the opportunity to add custom tags to any entry. After
adding tags to one or more entries, you can call methods on the calendar to show or
hide entries based on their tags by calling the BBjCalendarWidget::setVisibleTags()
and
BBjCalendarWidget::setHiddenTags()
methods.
This is similar to the setHiddenTags()
method that takes a BBjVector except that it takes a comma-delimted string of tags for succinctness.
BBjString
- A comma-delimted string of tags such as "work, programming, personal".void setHiddenTags(BBjVector tags!)
CalendarEntry
custom class offers
setTags() methods that give you the opportunity to add custom tags to any entry. After
adding tags to one or more entries, you can call methods on the calendar to show or
hide entries based on their tags by calling the BBjCalendarWidget::setVisibleTags()
and
BBjCalendarWidget::setHiddenTags()
methods.BBjVector
- A vector filled with tags such as "work", "programming", "meeting", etc.BBjString getViewType()
CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK()
.CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()
.CalendarAPI.CALENDAR_VIEW_TIME_GRID_DAY()
.CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()
.CalendarAPI.CALENDAR_VIEW_LIST_DAY()
.CalendarAPI.CALENDAR_VIEW_LIST_WEEK()
.CalendarAPI.CALENDAR_VIEW_LIST_MONTH()
.CalendarAPI.CALENDAR_VIEW_LIST_YEAR()
.CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK()
.void setViewType(BBjString viewType!)
Note: Calling this method causes the calendar to change its view, which then results in a
CalendarAPI.ON_CALENDAR_VIEW_CHANGE
event.
The provided view type should be one of the following constants:
CalendarAPI.CALENDAR_VIEW_DAY_GRID_WEEK()
.CalendarAPI.CALENDAR_VIEW_DAY_GRID_MONTH()
.CalendarAPI.CALENDAR_VIEW_TIME_GRID_DAY()
.CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()
.CalendarAPI.CALENDAR_VIEW_LIST_DAY()
.CalendarAPI.CALENDAR_VIEW_LIST_WEEK()
.CalendarAPI.CALENDAR_VIEW_LIST_MONTH()
.CalendarAPI.CALENDAR_VIEW_LIST_YEAR()
.BBjString
- viewType! The desired calendar view type, such as CalendarAPI.CALENDAR_VIEW_TIME_GRID_WEEK()
.static BBjVector getThemes()
After determining which themes are available, you can call the setTheme()
method specifying any of the theme names in the return vector to change the calendar's theme.
Note that the installed themes are located in the BBjCalendarWidget's lib/bootstrap/themes/
directory. The installed themes
are free Bootstrap themes from https://bootswatch.com/
, although free
Bootstrap themes are available from many other sites such as
https://startbootstrap.com/themes
.
If you would like to add more themes, create a subdirectory under the calendar's themes directory and copy the bootstrap.css
and
bootstrap.min.css
files in the newly-created subdirectory. The calendar will attempt to find and use the
bootstrap.min.css
first due to its reduced size.
void setTheme(BBjString theme!)
To determine which themes are available, you can call the getThemes()
method which returns a BBjVector filled with the installed theme names.
Note that the installed themes are located in the BBjCalendarWidget's lib/bootstrap/themes/
directory. The installed themes
are free Bootstrap themes from https://bootswatch.com/
, although free
Bootstrap themes are available from many other sites such as
https://startbootstrap.com/themes
.
If you would like to add more themes, create a subdirectory under the calendar's themes directory and copy the bootstrap.css
and
bootstrap.min.css
files in the newly-created subdirectory. The calendar will attempt to find and use the
bootstrap.min.css
first due to its reduced size.
BBjString
- theme!void setCallback(BBjNumber event!, BBjString callback!)
These are the valid callback event type options:
CalendarAPI.ON_CALENDAR_READY
- the calendar is ready for interactionCalendarAPI.ON_CALENDAR_VIEW_CHANGE
- the calendar's view has changedCalendarAPI.ON_CALENDAR_ENTRIES_SET
- entries have been changed or initialized in any wayCalendarAPI.ON_CALENDAR_ENTRY_CLICK
- the user clicked on an entryCalendarAPI.ON_CALENDAR_ENTRY_ADD
- an entry was added to the calendarCalendarAPI.ON_CALENDAR_ENTRY_CHANGE
- the entry has been modifiedCalendarAPI.ON_CALENDAR_ENTRY_REMOVE
- the entry has been removed from the calendarCalendarAPI.ON_CALENDAR_ENTRY_MOUSE_ENTER
- the user moved the mouse on an entryCalendarAPI.ON_CALENDAR_ENTRY_MOUSE_LEAVE
- the user moved the mouse off an entryCalendarAPI.ON_CALENDAR_ENTRY_DRAG_START
- the user began dragging an entire entryCalendarAPI.ON_CALENDAR_ENTRY_DRAG_STOP
- the user stopped dragging the entryCalendarAPI.ON_CALENDAR_ENTRY_DROP
- the user has completed dragging and dropping the entire entryCalendarAPI.ON_CALENDAR_ENTRY_RESIZE_START
- the user began to resize the entry to change its durationCalendarAPI.ON_CALENDAR_ENTRY_RESIZE_STOP
- the user stopped resizing the entryCalendarAPI.ON_CALENDAR_ENTRY_RESIZE
- the user completed resizing the entry resulting in a changed durationCalendarAPI.ON_CALENDAR_ENTRY_RECEIVE
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_ENTRY_LEAVE
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_DROP
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_DATES_SET
- the calendar's range has been initially set or changed in some wayCalendarAPI.ON_CALENDAR_DATE_CLICK
- the user clicked on a date or time in the calendarCalendarAPI.ON_CALENDAR_SELECT
- the user selected a date or time in the calendar (not an entry)CalendarAPI.ON_CALENDAR_UNSELECT
- the date/time selection has been clearedCalendarAPI.ON_CALENDAR_ENTRY_SOURCE_SUCCESS
- fetching a CalendarEntrySource has succededCalendarAPI.ON_CALENDAR_ENTRY_SOURCE_FAILURE
- fetching a CalendarEntrySource has failedNote: Callbacks associated with dragging/dropping calendar entries between two different calendars has not yet been implemented.
BBjNumber
- event! The event number which is one of the CalendarAPI.ON_CALENDAR_*
constants.BBjString
- callback! The program's callback subroutine label.void setCallback(BBjNumber event!, CustomObject instance!, BBjString method!)
These are the valid callback event type options:
CalendarAPI.ON_CALENDAR_READY
- the calendar is ready for interactionCalendarAPI.ON_CALENDAR_VIEW_CHANGE
- the calendar's view has changedCalendarAPI.ON_CALENDAR_ENTRIES_SET
- entries have been changed or initialized in any wayCalendarAPI.ON_CALENDAR_ENTRY_CLICK
- the user clicked on an entryCalendarAPI.ON_CALENDAR_ENTRY_ADD
- an entry was added to the calendarCalendarAPI.ON_CALENDAR_ENTRY_CHANGE
- the entry has been modifiedCalendarAPI.ON_CALENDAR_ENTRY_REMOVE
- the entry has been removed from the calendarCalendarAPI.ON_CALENDAR_ENTRY_MOUSE_ENTER
- the user moved the mouse on an entryCalendarAPI.ON_CALENDAR_ENTRY_MOUSE_LEAVE
- the user moved the mouse off an entryCalendarAPI.ON_CALENDAR_ENTRY_DRAG_START
- the user began dragging an entire entryCalendarAPI.ON_CALENDAR_ENTRY_DRAG_STOP
- the user stopped dragging the entryCalendarAPI.ON_CALENDAR_ENTRY_DROP
- the user has completed dragging and dropping the entire entryCalendarAPI.ON_CALENDAR_ENTRY_RESIZE_START
- the user began to resize the entry to change its durationCalendarAPI.ON_CALENDAR_ENTRY_RESIZE_STOP
- the user stopped resizing the entryCalendarAPI.ON_CALENDAR_ENTRY_RESIZE
- the user completed resizing the entry resulting in a changed durationCalendarAPI.ON_CALENDAR_ENTRY_RECEIVE
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_ENTRY_LEAVE
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_DROP
- Not Yet Implemented, deals with dragging and dropping entries from an external sourceCalendarAPI.ON_CALENDAR_DATES_SET
- the calendar's range has been initially set or changed in some wayCalendarAPI.ON_CALENDAR_DATE_CLICK
- the user clicked on a date or time in the calendarCalendarAPI.ON_CALENDAR_SELECT
- the user selected a date or time in the calendar (not an entry)CalendarAPI.ON_CALENDAR_UNSELECT
- the date/time selection has been clearedCalendarAPI.ON_CALENDAR_ENTRY_SOURCE_SUCCESS
- fetching a CalendarEntrySource has succededCalendarAPI.ON_CALENDAR_ENTRY_SOURCE_FAILURE
- fetching a CalendarEntrySource has failedNote: Callbacks associated with dragging/dropping calendar entries between two different calendars has not yet been implemented.
BBjNumber
- event! The event number which is one of the CalendarAPI.ON_CALENDAR_*
constants.CustomObject
- instance! The program's custom class instance, usually #this!BBjString
- method! The program's custom class's method name.void clearCallback(BBjNumber event!)
BBjNumber
- event! The event number which is one of the CalendarAPI.ON_CALENDAR_*
constants.void setBackColor(BBjColor backColor!)
BBjColor
- backColor! A BBjColor that defines the containing window's background color.BBjColor getBackColor()
void setUserData(Object userData!)
getUserData()
method.Object
- userData! The object to associate with the widget.Object getUserData()
setUserData()
method.void setEnabled(boolean enabled!)
boolean
- enabled! A boolean that indicates whether the widget should be enabled (1) or not (0).boolean isEnabled()
void setVisible(boolean visible!)
boolean
- visible! A boolean that indicates whether the widget should be visible (1) or not (0).boolean isVisible()
BBjNumber getWidth()
BBjNumber getHeight()
void setSize(BBjNumber width!, BBjNumber height!)
BBjNumber
- width! The widget's width.BBjNumber
- height! The widget's height.BBjNumber getX()
BBjNumber getY()
void setLocation(BBjNumber x!, BBjNumber y!)
BBjNumber
- x! The widget's X coordinate.BBjNumber
- y! The widget's Y coordinate.String getName()
setName()
method.void setName(BBjString name!)
getName()
method.
This value is propagated to the CSS class attribute of the HTML element representing the control in BUI.BBjString
- name! The widget's name.boolean addStyle(BBjString style!)
BBjString
- style! The CSS style name to add to the widget.boolean removeStyle(BBjString style!)
BBjString
- style! The CSS style name to remove from the widget.void clearStyles()
void setStyle(BBjString property!, BBjString style!)
BBjString
- property! The CSS property name to set.BBjString
- style! The CSS value to be assigned to the provided CSS property.BBjVector getStyles()
setName()
method.BBjString getStyle(BBjString property!)
BBjString
- property! The CSS property name to get the value of.void navigatePrev()
void navigateNext()
void navigatePrevYear()
void navigateNextYear()
void navigateToday()
void navigateDate(BBjString date!)
"YYYY-MM-DD"
given a date string in another format.
If the provided string is ambiguous, there are no guarantees that the method will be able to resolve the date/time string correctly.
The success of this method depends on the format of the supplied date/time string and the client's browser. For example, a date of
"1-2-3"
is very ambiguous and while the method may be able to return a valid date string, it may not be the particular
date that you had in mind. That's because there is no good way to know which number corresponds to the year, month, and day. However,
a string like "Jan 1, 2000"
is far less ambiguous and will likely be parsed correctly in to "2000-01-01"
.
Additionally, since the method uses JavaScript when parsing dates and time, the success is dependant on the browser's JavaScript implementation.
For example, at the time of this writing, Chrome can parse ambiguous dates like "May 2020"
and "May 15"
.
However, Firefox returns an "Invalid Date" for those values.
The date string should ideally be in the "YYYY-MM-DD"
format at a minimum, but the parser should be able to interpret various formats.
BBjString
- date! The date string that will be parsed and then passed to the FullCalendar's gotoDate() method.void navigateTime(BBjString time!)
"hh:mm"
format at a minimum.. However, this method attempts to parse ambiguous
times and is often able to construct a time in the format "hh:mm:ss"
given a time string in another format.
If the provided string is ambiguous, there are no guarantees that the method will be able to resolve the date/time string correctly.
The success of this method depends on the format of the supplied date/time string and the client's browser. For example, a date of
"1-2-3"
is very ambiguous and while the method may be able to return a valid date string, it may not be the particular
date that you had in mind. That's because there is no good way to know which number corresponds to the year, month, and day. However,
a string like "Jan 1, 2000"
is far less ambiguous and will likely be parsed correctly in to "2000-01-01"
.
Additionally, since the method uses JavaScript when parsing dates and time, the success is dependant on the browser's JavaScript implementation.
For example, at the time of this writing, Chrome can parse ambiguous dates like "May 2020"
and "May 15"
.
However, Firefox returns an "Invalid Date" for those values.
The time string should ideally be in one of the following formats.
BBjString
- time! The time string that will be parsed and then passed to the FullCalendar's scrollToTime() method.BBjString getDate()
BBjString getDateAsISOString()
static BBjString getJsonObjectAsFormattedString(JsonObject json!)
JsonObject
- json! The JSON object to be formatted.static JsonArray getBBjVectorAsJsonArray(BBjVector vector!)
BBjVector
- vector! The BBjVector to be converted to a JSON array.static BBjVector getJsonArrayAsBBjVector(JsonArray array!)
JsonArray
- array! The JSON array to be converted to a BBjVector.static JsonArray convertEntriesBBjVectorToJsonArray(BBjVector entries!)
CalendarEntry
object to a JSON array of calendar entries.BBjVector
- entries! A BBjVector filled with CalendarEntry
objects.static BBjVector convertEntriesArrayToBBjVector(JsonArray entries!)
JsonArray
- entries! A JsonArray of calendar entries.CalendarEntry
objects.static BBjVector convertEntriesArrayToBBjVector(BBjString entries!)
CalendarEntry
objects.BBjString
- entries! A stringified JSON array of calendar entries.CalendarEntry
objects.BBjString getEventDescription(BBjNumber eventNumber!)
CalendarAPI.ON_CALENDAR_*
callback constants.BBjNumber
- eventNumber! The event number that is one of the CalendarAPI.ON_CALENDAR_*
callback constants.BBjString getValidDateString(BBjString dateString!)
Note: An ISO 8601 formatted date/time string (YYYY-MM-DDTHH:mm:ss.sssZ
) is never ambiguous, but this method exists to attempt to parse an ambiguous
date/time string into an ISO 8601 formatted date/time string. If the provided string is ambiguous, there are no guarantees that the method will be able to
resolve the date/time string correctly. The success of this method depends on the format of the supplied date/time string and the client's browser. For example,
a date of "1-2-3"
is very ambiguous and while the method may be able to return a valid date string, it may not be the particular date that you had in mind.
That's because there is no good way to know which number corresponds to the year, month, and day. However, a string like "Jan 1, 2000"
is far less
ambiguous and will likely be parsed correctly in to "2000-01-01"
.
Additionally, since the method uses JavaScript when parsing dates, the success is dependant on the browser's JavaScript implementation. For example, at the time of
this writing, Chrome can parse ambiguous dates like "May 2020"
and "May 15"
. However, Firefox returns an "Invalid Date" for those values.
BBjString
- dateString! A string that contains a date representation. If you provide a ISO formatted date, such as 2022-12-25, thenBBjString getValidTimeString(BBjString timeString!)
Note: An ISO 8601 formatted date/time string (YYYY-MM-DDTHH:mm:ss.sssZ
) is never ambiguous, but this method exists to attempt to parse an ambiguous
date/time string into an ISO 8601 formatted date/time string. If the provided string is ambiguous, there are no guarantees that the method will be able to
resolve the date/time string correctly. The success of this method depends on the format of the supplied date/time string and the client's browser. For example,
a date of "1-2-3"
is very ambiguous and while the method may be able to return a valid date string, it may not be the particular date that you had in mind.
That's because there is no good way to know which number corresponds to the year, month, and day. However, a string like "Jan 1, 2000"
is far less
ambiguous and will likely be parsed correctly in to "2000-01-01"
.
Additionally, since the method uses JavaScript when parsing dates, the success is dependant on the browser's JavaScript implementation. For example, at the time of
this writing, Chrome can parse ambiguous dates like "May 2020"
and "May 15"
. However, Firefox returns an "Invalid Date" for those values.
BBjString
- timeString! A string that contains a time representation.BBjString getValidDateTimeString(BBjString dateTimeString!)
Note: An ISO 8601 formatted date/time string (YYYY-MM-DDTHH:mm:ss.sssZ
) is never ambiguous, but this method exists to attempt to parse an ambiguous
date/time string into an ISO 8601 formatted date/time string. If the provided string is ambiguous, there are no guarantees that the method will be able to
resolve the date/time string correctly. The success of this method depends on the format of the supplied date/time string and the client's browser. For example,
a date of "1-2-3"
is very ambiguous and while the method may be able to return a valid date string, it may not be the particular date that you had in mind.
That's because there is no good way to know which number corresponds to the year, month, and day. However, a string like "Jan 1, 2000"
is far less
ambiguous and will likely be parsed correctly in to "2000-01-01"
.
Additionally, since the method uses JavaScript when parsing dates, the success is dependant on the browser's JavaScript implementation. For example, at the time of
this writing, Chrome can parse ambiguous dates like "May 2020"
and "May 15"
. However, Firefox returns an "Invalid Date" for those values.
BBjString
- dateTimeString! A string that contains a date/time representation.BBjNumber getLocalTimeZoneOffsetFromUtc()
void addEntry(JsonObject entry!)
Note: Adding entries to the calendar via this method will trigger the
CalendarAPI.ON_CALENDAR_ENTRY_ADD()
event.
JsonObject
- entry! The entry to be added to the calendar.void addEntries(JsonArray entries!)
Note: Adding multiple entries to the calendar via this method will not trigger the
CalendarAPI.ON_CALENDAR_ENTRY_ADD()
event.
JsonArray
- entries! A JsonArray filled with JSON objects to be added to the calendar.void addEntries(BBjVector entries!)
CalendarEntry
to the calendar at once for improved performance.
Note: Adding multiple entries to the calendar via this method will not trigger the
CalendarAPI.ON_CALENDAR_ENTRY_ADD()
event.
BBjVector
- entries! A BBjVector filled with CalendarEntry
objects to be added to the calendar.void addEntrySource(CalendarEntrySource entrySource!)
CalendarEntrySource
.CalendarEntrySource
- entrySource! A previously-defined CalendarEntrySource
.BBjVector getEntrySourceIds()
CalendarEntrySource
objects that have previously been added to the calendar via the addEntrySource()
method.CalendarEntrySource
object IDs that have previously been added to the calendar, or null() if none have been added.void removeEntrySource(BBjString id!)
CalendarEntrySource and its entries from the calendar given its unique ID.
BBjString
- id! A BBjString filled with the unique ID for the CalendarEntrySource to remove.
void refetchEntrySource(BBjString id!)
CalendarEntrySource object in the calendar given its unique ID, causing it to retrieve its entries again.
BBjString
- id! A BBjString filled with the unique ID for the CalendarEntrySource to remove.
BBjNumber removeAllEntrySources()
CalendarEntrySource objects from the calendar.
void refetchAllEntrySources()
CalendarEntrySource objects in the calendar, causing them to retrieve their entries again.
BBjVector getEntries()
CalendarEntry
objects.CalendarEntry
objects for all the events in the calendar.JsonArray getEntriesAsJsonArray()
BBjVector getEntriesWithTag(BBjString tag!)
CalendarEntry
objects.CalendarEntry
objects for all the events in the calendar.BBjVector getEntriesWithTags(BBjVector tags!)
CalendarEntry
objects.CalendarEntry
objects for all the events in the calendar.BBjNumber removeEntryById(BBjString id!)
BBjString
- id! A BBjString containing the entry's unique ID.BBjNumber removeEntry(CalendarEntry entry!)
CalendarEntry
- entry! The CalendarEntry
to remove from the calendar.BBjNumber removeEntries(BBjVector entries!)
Note: Removing entries from the calendar via this method will trigger the
CalendarAPI.ON_CALENDAR_ENTRY_REMOVE()
event for each entry that was removed.
BBjVector
- entries! A BBjVector filled with the CalendarEntry
objects to remove from the the calendar.BBjNumber removeAllEntries()
Note: Removing entries from the calendar via this method will trigger the
CalendarAPI.ON_CALENDAR_ENTRY_REMOVE()
event for each entry that was removed.
void updateEntry(CalendarEntry entry!)
This method uses the CalendarEntry
's ID (if set) or UUID (if the ID isn't set) to find the entry in the calendar. If found, it removes the
old version of the entry from the calendar, then adds the new version of the entry to the calendar. Because of that, if you've registered for the
CalendarAPI.ON_CALENDAR_ENTRY_ADD
or
CalendarAPI.ON_CALENDAR_ENTRY_REMOVE
events then your callback
code will executed as a result of calling this method.
CalendarEntry
- entry! The updated CalendarEntry
objectvoid updateEntries(JsonArray entries!)
This method iterates through the CalendarEntry
objects and calls the same code as the updateEntry()
method does. Therefore, it
uses the CalendarEntry
's ID (if set) or UUID (if the ID isn't set) to find the entry in the calendar. If found, it removes the
old version of the entry from the calendar, then adds the new version of the entry to the calendar. Because of that, if you've registered for the
CalendarAPI.ON_CALENDAR_ENTRY_ADD
or
CalendarAPI.ON_CALENDAR_ENTRY_REMOVE
events then your callback
code will executed once for each entry in the array as a result of calling this method.
JsonArray
- entries! A JsonArray filled with JSON objects to be added to the calendar.void updateEntries(BBjVector entries!)
CalendarEntry
to the calendar at once for improved performance.
This method iterates through the CalendarEntry
objects and calls the same code as the updateEntry()
method does. Therefore, it
uses the CalendarEntry
's ID (if set) or UUID (if the ID isn't set) to find the entry in the calendar. If found, it removes the
old version of the entry from the calendar, then adds the new version of the entry to the calendar. Because of that, if you've registered for the
CalendarAPI.ON_CALENDAR_ENTRY_ADD
or
CalendarAPI.ON_CALENDAR_ENTRY_REMOVE
events then your callback
code will executed once for each CalendarEntry
in the BBjVector as a result of calling this method.
BBjVector
- entries! A BBjVector filled with CalendarEntry
objects to be updated in the calendar.