Closed vlondon closed 1 year ago
Description When using SwiftUI's DatePicker with hourAndMinute and graphical date picker style it displays "Time" label that is not localised.
import SwiftUI struct ContentView: View { @State private var date = Date.now var body: some View { DatePicker( "", selection: $date, in: date..., displayedComponents: [.date, .hourAndMinute] ) .labelsHidden() .datePickerStyle(.graphical) .environment(\.locale, Locale.init(identifier: "de")) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Steps to reproduce Create a DatePicker with following config and change locale to non-english one (for example: de, lt):
.displayedComponents: [.date, .hourAndMinute]
.datePickerStyle(.graphical)
.environment(\.locale, Locale.init(identifier: "SOME_LOCALE"))
Expected behavior "Time" label to respect locale
Environment
SwiftUI is a closed-source framework, so this issue is best reported using the feedback assistant.
Description When using SwiftUI's DatePicker with hourAndMinute and graphical date picker style it displays "Time" label that is not localised.
Steps to reproduce Create a DatePicker with following config and change locale to non-english one (for example: de, lt):
.displayedComponents: [.date, .hourAndMinute]
.datePickerStyle(.graphical)
.environment(\.locale, Locale.init(identifier: "SOME_LOCALE"))
Expected behavior "Time" label to respect locale
Environment