CalendarModel
public class CalendarModel
The date model of the calendar.
-
The calendar style. The default is
.month.Declaration
Swift
public var calendarStyle: CalendarStyle { get set } -
The first day of the week for the calendar, default confirms system setting. The weekday units are one-based. For Gregorian and ISO 8601 calendars, 1 is Sunday, 2 is Monday, 3 is Tuesday, 4 is Wednesday, 5 is Thursday, 6 is Friday and 7 is Saturday.
Declaration
Swift
public var firstWeekday: Int { get set } -
The selected date in the calendar, used to single select, when the style is
.month,.fullScreenMonth,.weekor.expandable.Declaration
Swift
public var selectedDate: Date? { get set } -
The selected dates in the calendar, used to multi select, when the style is
.datesSelection.Declaration
Swift
public var selectedDates: Set<Date>? { get set } -
The selected range in the calendar, used to range select, when the style is
.rangeSelection.Declaration
Swift
public var selectedRange: ClosedRange<Date>? { get set } -
The disabled dates. Default is nil, which means all in month displayed dates are selectable.
Declaration
Swift
public var disabledDates: CalendarDisabledDates? { get set } -
The property is used to scroll to customize date. Developer can use this property to display whatever date in the available date range.
Declaration
Swift
public var scrollToDate: Date { get set } -
init(calendarStyle:startDate: endDate: displayDateAtStartup: selectedDate: selectedDates: selectedRange: disabledDates: isPersistentSelection: scrollToDate: firstWeekday: showsMonthHeader: expandableStyleInWeekMode: ) Public initializer for CalendarModel.
Declaration
Swift
public init(calendarStyle: CalendarStyle = .month, startDate: Date? = nil, endDate: Date? = nil, displayDateAtStartup: Date? = nil, selectedDate: Date? = nil, selectedDates: Set<Date>? = nil, selectedRange: ClosedRange<Date>? = nil, disabledDates: CalendarDisabledDates? = nil, isPersistentSelection: Bool = false, scrollToDate: Date? = nil, firstWeekday: Int? = nil, showsMonthHeader: Bool? = nil, expandableStyleInWeekMode: Bool = false)Parameters
calendarStyleThe calendar style. The default is
.month.startDateThe start date of the calendar. Default is current year’s first day.
endDateThe end date of the calendar. Default is next year’s last day.
displayDateAtStartupThe display date at startup.
selectedDateThe selected date in the calendar, used to single select, when the style is
.month,.fullScreenMonth,.weekor.expandable.selectedDatesThe selected dates in the calendar, used to multi select, when the style is
.datesSelection.selectedRangeThe selected range in the calendar, used to range select, when the style is
.rangeSelection.disabledDatesThe disabled dates. Default is nil, which means all in month displayed dates are selectable.
isPersistentSelectionBoolean indicates whether or not a selected date stays selected when the user scrolls away to another set of dates. The default is false.
scrollToDateThe property is used to scroll to customize date. Developer can use this property to display whatever date in the available date range.
firstWeekdayThe first day of the week for the calendar, default confirms system setting. The weekday units are one-based. For Gregorian and ISO 8601 calendars, 1 is Sunday, 2 is Monday, 3 is Tuesday, 4 is Wednesday, 5 is Thursday, 6 is Friday and 7 is Saturday.
showsMonthHeaderThis property indicates whether the month header should display.
expandableStyleInWeekModeThis property indicates whether the expandable style in week mode first. Default is false. Only available when style is
.expandable.