cake_wallet/lib/utils/date_formatter.dart

16 lines
490 B
Dart
Raw Normal View History

2020-09-21 11:50:26 +00:00
import 'package:intl/intl.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/store/settings_store.dart';
class DateFormatter {
static String get currentLocalFormat {
2020-09-28 15:47:43 +00:00
final isUSA = getIt.get<SettingsStore>().languageCode.toLowerCase() == 'en';
2020-09-21 11:50:26 +00:00
final format = isUSA ? 'yyyy.MM.dd, HH:mm' : 'dd.MM.yyyy, HH:mm';
return format;
}
static DateFormat withCurrentLocal() =>
DateFormat(currentLocalFormat, getIt.get<SettingsStore>().languageCode);
}