Skip to content

Commit 5697a6f

Browse files
author
danny
committed
Rolling back date formatting
1 parent 3eb20a1 commit 5697a6f

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

macless_haystack/lib/accessory/accessory_list_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AccessoryListItem extends StatelessWidget {
5555
// Format published date in a human readable way
5656
String? dateString = accessory.datePublished != null &&
5757
accessory.datePublished != DateTime(1970)
58-
? ' · ${DateFormat.yMd(Platform.localeName).format(accessory.datePublished!)} ${DateFormat.jm(Platform.localeName).format(accessory.datePublished!)}'
58+
? ' · ${DateFormat('dd.MM.yyyy HH:mm').format(accessory.datePublished!)}'
5959
: '';
6060
return ListTile(
6161
onTap: onTap,

macless_haystack/lib/history/location_popup.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'dart:io';
21

32
import 'package:flutter/material.dart';
43
import 'package:flutter_map/flutter_map.dart';
@@ -39,7 +38,8 @@ class LocationPopup extends Marker {
3938
Expanded(
4039
child: Center(
4140
child: Text(
42-
'${DateFormat.Md(Platform.localeName).format(time)} ${DateFormat.jm(Platform.localeName).format(time)} - ${DateFormat.Md(Platform.localeName).format(end)} ${DateFormat.jm(Platform.localeName).format(end)}',
41+
'${DateFormat('MM/dd H:mm', Localizations.localeOf(ctx).toString()).format(time.toLocal())} - ${DateFormat('MM/dd H:mm', Localizations.localeOf(ctx).toString()).format(end.toLocal())}',
42+
style: const TextStyle(fontWeight: FontWeight.bold),
4343
))),
4444
Expanded(
4545
child: Center(

macless_haystack/lib/main.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import 'package:macless_haystack/location/location_model.dart';
66
import 'package:macless_haystack/preferences/user_preferences_model.dart';
77
import 'package:macless_haystack/splashscreen.dart';
88
import 'package:flutter_settings_screens/flutter_settings_screens.dart';
9-
import 'package:intl/date_symbol_data_local.dart';
109

11-
void main() async {
10+
void main() {
1211
Settings.init();
13-
await initializeDateFormatting();
1412
runApp(const MyApp());
1513
}
1614

@@ -19,7 +17,6 @@ class MyApp extends StatelessWidget {
1917

2018
@override
2119
Widget build(BuildContext context) {
22-
2320
return MultiProvider(
2421
providers: [
2522
ChangeNotifierProvider(create: (ctx) => AccessoryRegistry()),
@@ -28,9 +25,7 @@ class MyApp extends StatelessWidget {
2825
],
2926
child: MaterialApp(
3027
title: 'Macless Haystack',
31-
theme: ThemeData(
32-
primarySwatch: Colors.blue
33-
),
28+
theme: ThemeData(primarySwatch: Colors.blue),
3429
darkTheme: ThemeData.dark(),
3530
home: const AppLayout(),
3631
),

0 commit comments

Comments
 (0)