Skip to main content

Calendar (캘린더) Widget Control

This page lists the Widget Control (Property · Method · Event) you use to control the Calendar widget from a script. For an introduction to the widget and how to use it, visit Calendar.

info

In the examples below, calendarID is the name (ID) you assigned to the Calendar widget on the canvas. In a script, you access members as widgetID.member.

Widget Control summary

Widget ControlKindSignatureDescription
selectedDateProperty (read-only)calendarID.selectedDateReturns the currently selected date as a yyyyMMdd string
eventDateProperty (write-only)calendarID.eventDate = [...]Sets the list of dates to mark with an event dot
goToDayMethodcalendarID.goToDay(date)Moves to the date you pass
goToTodayMethodcalendarID.goToToday()Moves to today
expandMethodcalendarID.expand()Expands to the full month view
collapseMethod (Deprecated)calendarID.collapse()Collapses to the week view (deprecated)
onPageChangedEventonPageChanged = (date) => { ... }Runs when the visible month (page) changes
onDateSelectedEventonDateSelected = (date) => { ... }Runs when a date is selected

Property

selectedDate

Returns the currently selected date as a yyyyMMdd string. When no date is selected, it returns an empty string ('').

  • Kind: Property (read-only)
  • Type: string (yyyyMMdd format)

Example

const date = calendarID.selectedDate; // e.g. "20260622" or ""

eventDate

Sets the list of dates to mark with an event dot on the calendar. Each date must be a yyyyMMdd string.

  • Kind: Property (write-only)
  • Type: array of strings (string[], each element in yyyyMMdd format)

Example

calendarID.eventDate = ["20260622", "20260625"];

Method

goToDay(date)

Moves the calendar to the date you pass. If the value can't be parsed as a date, nothing happens.

  • Parameters: date - the date to move to (yyyyMMdd string)
  • Returns: None (void)

Example

calendarID.goToDay("20260622");

goToToday()

Moves the calendar to today's date.

  • Parameters: None
  • Returns: None (void)

Example

calendarID.goToToday();

expand()

Expands the calendar to the full month view.

  • Parameters: None
  • Returns: None (void)

Example

calendarID.expand();

collapse()

Collapses the calendar to the week view.

warning

collapse() is a deprecated method — we no longer recommend it. That's also why it appears with a strikethrough in the script autocomplete list in Lucy Studio. It still works today and switches to the week view, but a later version may remove it. To control whether the calendar shows a month or a week, use the widget's calendarFormat property (month/week) instead.

  • Parameters: None
  • Returns: None (void)

Example

calendarID.collapse();

Event

onPageChanged

Runs when the visible month (page) changes. Assign a callback function to define what happens.

  • Kind: Event
  • Handler: (date) => { ... } - date is the reference date of the newly shown page (yyyyMMdd format)
  • Returns: None

Example

calendarID.onPageChanged = (date) => {
// Code to run when the page (month) changes
};

onDateSelected

Runs when someone selects a date. Assign a callback function to define what happens.

  • Kind: Event
  • Handler: (date) => { ... } - date is the selected date (yyyyMMdd format)
  • Returns: None

Example

calendarID.onDateSelected = (date) => {
// Code to run when a date is selected
};

Common Widget Control (all widgets)

note

Every widget can use name-based common Widget Control (Method) such as setProperty / getProperty / setStyleProperty. See the common reference doc (to be written).