Skip to content

Commit

Permalink
Update getDateStr to support full locale string
Browse files Browse the repository at this point in the history
  • Loading branch information
emavgl committed Jun 1, 2024
1 parent 9dc4316 commit 6699a70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/helpers/datetime-utility-functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ String getDateStr(DateTime? dateTime, {AggregationMethod? aggregationMethod}) {
Locale myLocale = I18n.locale;
if (aggregationMethod != null) {
if (aggregationMethod == AggregationMethod.MONTH) {
return DateFormat.yM(myLocale.languageCode).format(dateTime!);
return DateFormat.yM(myLocale.toString()).format(dateTime!);
}
if (aggregationMethod == AggregationMethod.YEAR) {
return DateFormat.y(myLocale.languageCode).format(dateTime!);
return DateFormat.y(myLocale.toString()).format(dateTime!);
}
}
return DateFormat.yMd(myLocale.languageCode).format(dateTime!);
return DateFormat.yMd(myLocale.toString()).format(dateTime!);
}

String extractMonthString(DateTime dateTime) {
Expand Down

0 comments on commit 6699a70

Please sign in to comment.