SWIFTUI DatePicker with Calendar identifier

does anyone know how to configure Swift DatePicker using a set Calendar identifier so that the calendar display on the date picker is in identified months and dates (e.g., Hebrew, Ethiopic, etc.) without setting an environmental locale?

Struct DateView: View {

@State var selectedDate = Date()

let dateFormatter: DateFormatter = {
    let formatter = DateFormatter()
    formatter.dateStyle = .medium
    return formatter
    }()


var body: some View {
    DatePicker("Please enter a date", selection: $selectedDate, displayedComponents: .date)
        .datePickerStyle(WheelDatePickerStyle())
    Divider()
    Text ("You selected \(selectedDate,formatter: dateFormatter)")
    Spacer()
}
}

To make SwiftUI's DatePicker display different calendars, you need to set the calendar environment value.

.environment(\.calendar, Calendar(identifier: .hebrew)

Using your example, to display a Hebrew calendar add the modifier above

Struct DateView: View {

    @State var selectedDate = Date()

    let dateFormatter: DateFormatter = {
        let formatter = DateFormatter()
        formatter.dateStyle = .medium
        return formatter
    }()

    var body: some View {
        DatePicker("Please enter a date", selection: $selectedDate, displayedComponents: .date)
            .datePickerStyle(WheelDatePickerStyle())
            .environment(\.calendar, Calendar(identifier: .hebrew))
        Divider()
        Text ("You selected \(selectedDate,formatter: dateFormatter)")
        Spacer()
    }
}
SWIFTUI DatePicker with Calendar identifier
 
 
Q