DateTimePicker
public struct DateTimePicker
extension DateTimePicker: View
extension DateTimePicker: _ViewEmptyChecking
DateTimePicker
provides a title and value label with Fiori styling and a DatePicker
.
Usage
@State var selection: Date = .init(timeIntervalSince1970: 0.0)
@State var isRequired = false
@State var showsErrorMessage = false
DateTimePicker(title: "Default", isRequired: self.isRequired, selectedDate: self.$selection)
.informationView(isPresented: self.$showsErrorMessage, description: AttributedString("The Date should be before December."))
.informationViewStyle(.informational)
-
init(title:
valueLabel: mandatoryFieldIndicator: isRequired: controlState: errorMessage: selectedDate: pickerComponents: dateStyle: timeStyle: noDateSelectedString: ) Undocumented
Declaration
Swift
public init(@ViewBuilder title: () -> any View, @ViewBuilder valueLabel: () -> any View = { EmptyView() }, @ViewBuilder mandatoryFieldIndicator: () -> any View = { Text("*") }, isRequired: Bool = false, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, selectedDate: Binding<Date>, pickerComponents: DatePicker.Components = [.date, .hourAndMinute], dateStyle: Date.FormatStyle.DateStyle = .abbreviated, timeStyle: Date.FormatStyle.TimeStyle = .shortened, noDateSelectedString: String? = nil)
-
init(title:
valueLabel: mandatoryFieldIndicator: isRequired: controlState: errorMessage: selectedDate: pickerComponents: dateStyle: timeStyle: noDateSelectedString: ) Undocumented
Declaration
Swift
init(title: AttributedString, valueLabel: AttributedString? = nil, mandatoryFieldIndicator: TextOrIcon? = .text("*"), isRequired: Bool = false, controlState: ControlState = .normal, errorMessage: AttributedString? = nil, selectedDate: Binding<Date>, pickerComponents: DatePicker.Components = [.date, .hourAndMinute], dateStyle: Date.FormatStyle.DateStyle = .abbreviated, timeStyle: Date.FormatStyle.TimeStyle = .shortened, noDateSelectedString: String? = nil)
-
Undocumented
Declaration
Swift
init(_ configuration: DateTimePickerConfiguration)
-
Declaration
Swift
public var body: some View { get }
-
Undocumented
Declaration
Swift
public var isEmpty: Bool { get }