vds_ios/VDS/Components/DatePicker/DatePickerCalendarModel.swift
Matt Bruce 6d0e334f73 refactored out classes/structs into files
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-05-14 16:41:02 -05:00

63 lines
2.5 KiB
Swift

//
// DatePicker-CalendarModel.swift
// VDS
//
// Created by Matt Bruce on 5/14/24.
//
import Foundation
import UIKit
extension DatePicker {
public struct CalendarModel {
public let surface: Surface
/// If set to true, the calendar will not have a border.
public let hideContainerBorder: Bool
/// If set to true, the calendar will not have current date indication.
public let hideCurrentDateIndicator: Bool
/// Enable specific days. Pass an array of string value in date format e.g. ['07/21/2024', '07/24/2024', 07/28/2024'].
/// All other dates will be inactive.
public let activeDates: [Date]
/// Disable specific days. Pass an array of string value in date format e.g. ['07/21/2024', '07/24/2024', 07/28/2024'].
/// All other dates will be active.
public let inactiveDates: [Date]
/// If provided, the calendar will allow a selection to be made from this date forward. Defaults to today.
public let minDate: Date
/// If provided, the calendar will allow a selection to be made up to this date.
public let maxDate: Date
/// If provided, this is the date that will show as selected by the Calendar.
/// If no value is provided, the current date will be used. If null is provided, no date will be selected.
public let selectedDate: Date
/// Array of ``CalendarIndicatorModel`` you are wanting to show on legend.
public let indicators: [CalendarBase.CalendarIndicatorModel]
public init(surface: Surface = .light,
hideContainerBorder: Bool = false,
hideCurrentDateIndicator: Bool = false,
selectedDate: Date = Date(),
activeDates: [Date] = [],
inactiveDates: [Date] = [],
minDate: Date = Date().startOfMonth,
maxDate: Date = Date().endOfMonth,
indicators: [CalendarBase.CalendarIndicatorModel] = []) {
self.surface = surface
self.hideContainerBorder = hideContainerBorder
self.hideCurrentDateIndicator = hideCurrentDateIndicator
self.selectedDate = selectedDate
self.activeDates = activeDates
self.inactiveDates = inactiveDates
self.minDate = minDate
self.maxDate = maxDate
self.indicators = indicators
}
}
}