The calendar component is used to display a calendar and allow the selection of one or multiple dates.

Component Code

The first section of the component contains all the variables needed for the component to function.


This method is called when the component if first loaded and when there’s an update to its parent component.

Inside this method, several field definitions are retrieved using their property names and set to object variables for later use. Additionally, the type of selection for the calendar is determined based on the CalendarSelectionType property and is set to the CalendarSelectionMode property accordingly. Disabled dates are also parsed from the CalendarDisabledDates property.

Finally, the selected values for the calendar are assigned from either the pending changes or database values (if none exist, default values are used). An await base.OnParametersSetAsync() statement is called to end the method.

ValueChangedRangeStart(DateTime startDate)

This method is called when the start date of a range is selected. Its purpose is to assign the value to the RangeStart variable.

ValueChangedRangeEnd(DateTime endDate)

This method is called when the end date of a range is selected. Its purpose is to assign the value to the RangeEnd variable. It also checks to make sure the value is not the default DateTime value, if it’s not then ValueChanged() is called to update the XML.

ValueChanged(DateTime selectedDate = new())

This method is called when the selected date has changed (when using single or multi date selection) and by ValueChangedRangeEnd() when the end date of a range has been selected.

Its purpose is to first ensure the field is modifiable, then validate the dates, if there are no validation errors then ChangeXML() is called.


This method is called by ValueChanged(). Its purpose is to save the selected date(s) to the instances XML.

Below are the XML formats depending on the calendars selection type.

Multiple Dates:

     <Type>Multiple Dates</Type>

Date Range:

     <Type>Date Range</Type>
         23/12/23 - 18/01/24

Single Date:

     <Type>Single Date</Type>
Updated on June 3, 2024

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support