Workaround intl bug by harding 'en' locale

https://github.com/dart-lang/intl/issues/266

This is strange since Intl.getLocale() returns 'en_US' in my case.

Currently, GitJournal only supports 'english' anyway, so this shouldn't
be a big problem.
This commit is contained in:
Vishesh Handa
2020-06-09 18:23:43 +02:00
parent 9ba0bc831c
commit cd9d128b47
5 changed files with 8 additions and 8 deletions

View File

@ -13,8 +13,8 @@ class JournalView extends StatelessWidget {
final NotesFolder folder; final NotesFolder folder;
final String emptyText; final String emptyText;
static final _dateFormat = DateFormat('dd MMM, yyyy '); static final _dateFormat = DateFormat('dd MMM, yyyy ', 'en');
static final _timeFormat = DateFormat('Hm'); static final _timeFormat = DateFormat('Hm', 'en');
JournalView({ JournalView({
@required this.folder, @required this.folder,

View File

@ -22,7 +22,7 @@ class StandardView extends StatelessWidget {
final StandardViewHeader headerType; final StandardViewHeader headerType;
final bool showSummary; final bool showSummary;
static final _dateFormat = DateFormat('dd MMM, yyyy'); static final _dateFormat = DateFormat('dd MMM, yyyy', 'en');
StandardView({ StandardView({
@required this.folder, @required this.folder,

View File

@ -189,7 +189,7 @@ class GitHostSetupRepoSelectorState extends State<GitHostSetupRepoSelector> {
} }
Widget _buildRepoTile(GitHostRepo repo) { Widget _buildRepoTile(GitHostRepo repo) {
final _dateFormat = DateFormat('dd MMM, yyyy'); final _dateFormat = DateFormat('dd MMM, yyyy', 'en');
Widget trailing = Container(); Widget trailing = Container();
if (repo.updatedAt != null) { if (repo.updatedAt != null) {

View File

@ -2,8 +2,8 @@ import 'dart:core';
import 'package:gitjournal/utils/logger.dart'; import 'package:gitjournal/utils/logger.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
final _simpleDateFormat = DateFormat("yyyy-MM-dd-HH-mm-ss"); final _simpleDateFormat = DateFormat("yyyy-MM-dd-HH-mm-ss", 'en');
final _iso8601DateFormat = DateFormat("yyyy-MM-ddTHH:mm:ss"); final _iso8601DateFormat = DateFormat("yyyy-MM-ddTHH:mm:ss", 'en');
String toSimpleDateTime(DateTime dt) { String toSimpleDateTime(DateTime dt) {
return _simpleDateFormat.format(dt); return _simpleDateFormat.format(dt);

View File

@ -12,8 +12,8 @@ class JournalEditorHeader extends StatelessWidget {
if (note.created == null) { if (note.created == null) {
return Container(); return Container();
} }
var dateStr = DateFormat('MMMM, yyyy').format(note.created); var dateStr = DateFormat('MMMM, yyyy', 'en').format(note.created);
var timeStr = DateFormat('EEEE HH:mm').format(note.created); var timeStr = DateFormat('EEEE HH:mm', 'en').format(note.created);
var bigNum = Text( var bigNum = Text(
note.created.day.toString(), note.created.day.toString(),