You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm merging a PR to take the locale in consideration.
For the selected date, the ordinal day is only supported in English, this is the default used by ShadDatePicker
StringdefaultDateFormat(DateTime date, Locale locale) {
final ordinalDay = date.getOrdinalDay();
final month =
intl.DateFormat('MMMM', locale.toLanguageTag()).format(date); // Octoberfinal year =
intl.DateFormat('y', locale.toLanguageTag()).format(date); // 2024return'$month $ordinalDay, $year'; // October 1st, 2024
}
I suggest creating a custom date format for italian, like:
StringdateFormat(DateTime date, Locale locale) {
final month =DateFormat('MMMM', locale.toLanguageTag()).format(date); // gennaiofinal year =DateFormat('y', locale.toLanguageTag()).format(date); // 2025return'${date.day} $month $year'; // 1 gennaio 2024
}
final locale =Localizations.localeOf(context);
ShadDatePicker(
formatDate: (date) =>dateFormat(date, locale),
)
Steps to reproduce
Following this guide the Locale passed in ShadApp does not set the Locale in ShadDatePicker.
Expected results
Actual results
shadcn_ui version
0.18.0
Platform
Windows
Code sample
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
The text was updated successfully, but these errors were encountered: