Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix date formatting in edit time

Neeraj Guptab08d8de1c8eb
diff --git a/mobile/lib/ui/viewer/date/edit_date_sheet.dart b/mobile/lib/ui/viewer/date/edit_date_sheet.dart
index 1ae6a12eb2..39c5381909 100644
--- a/mobile/lib/ui/viewer/date/edit_date_sheet.dart
+++ b/mobile/lib/ui/viewer/date/edit_date_sheet.dart
@@ -264,7 +264,7 @@ class DateAndTimeWidget extends StatelessWidget {
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
final locale = Localizations.localeOf(context);
- final String date = DateFormat.yMMMd(locale.languageCode).format(dateTime);
+ final String date = DateFormat.yMMMd(locale.toString()).format(dateTime);
final String time = DateFormat(
MediaQuery.of(context).alwaysUse24HourFormat ? 'HH:mm' : 'h:mm a',
).format(dateTime);
@@ -628,7 +628,7 @@ class PhotoDateHeaderWidget extends StatelessWidget {
),
const SizedBox(height: 4),
Text(
- "${DateFormat.yMEd(locale.languageCode).format(startDate)} Β· ${DateFormat(
+ "${DateFormat.yMEd(locale.toString()).format(startDate)} Β· ${DateFormat(
MediaQuery.of(context).alwaysUse24HourFormat
? 'HH:mm'
: 'h:mm a',
@@ -648,7 +648,7 @@ class PhotoDateHeaderWidget extends StatelessWidget {
}
String _formatDate(DateTime date, Locale locale, BuildContext context) {
- return "${DateFormat.yMEd(locale.languageCode).format(date)}\n${DateFormat(
+ return "${DateFormat.yMEd(locale.toString()).format(date)}\n${DateFormat(
MediaQuery.of(context).alwaysUse24HourFormat ? 'HH:mm' : 'h:mm a',
).format(date)}";
}