-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to reproduce
I have implemented a picker with CupertinoDatePicker to select a day within a reservation process. I need the day of the week to be displayed to help the users in the booking so I have enabled the following parameter:
showDayOfWeek: true,The issue occurs when combining this showDayOfWeek: true and this mode:
mode: CupertinoDatePickerMode.dateIn this case the day of the week always displays in EN. The application supports EN, ES, and CA. One might think it's because the localizations are not properly configured, but the months appear in the correct language according to the device's locale. However, the day of the week does not. Additionally, if the mode is changed to
mode: CupertinoDatePickerMode.dateAndTimethe day of the week appears in the proper language. I am attaching screenshots.
Expected results
The day of the week should vary according to the locale, just like the language of the months changes
Actual results
The day of the week always appears in English
Code sample
I have this locale configuration in Material App of main.dart
Code sample
supportedLocales: const [
Locale('es'), // Spanish
Locale('ca'), // Catalan
Locale('en'), // English
],
locale: locale,
onGenerateRoute: (_) => SplashScreen.route(),
localizationsDelegates: [
widget.flutterI18nDelegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
],That's the implementation of CupertinoDatePickerWidget. The error occurs specifically in date mode.
CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
showDayOfWeek: true,
minimumDate: DateTime(now.year, now.month, now.day, 0, 0, 0, 0),
maximumYear: DateTime.now().year + 1,
minimumYear: DateTime.now().year,
initialDateTime: widget.dayPicked,
maximumDate: DateTime.now().add(const Duration(days: 365)),
onDateTimeChanged: (datePicked) {
widget.onDateChanged!(datePicked);
}),Screenshots or Video
Screenshots / Video demonstration
  Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.13.5, on macOS 12.6.9 21G726 darwin-x64, locale es-ES)
• Flutter version 3.13.5 on channel stable at /Users/edumolins/Desktop/flutter_313
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 12fccda598 (4 months ago), 2023-09-19 13:56:11 -0700
• Engine revision bd986c5ed2
• Dart version 3.1.2
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
• Android SDK at /Users/edumolins/Library/Android/sdk
• Platform android-33, build-tools 33.0.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[✓] Connected device (3 available)
• 2306EPN60G (mobile) • 4P4PNVOZBUM7QOVO • android-arm64 • Android 14 (API 34)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6.9 21G726 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.234
[✓] Network resources
• All expected network resources are available.