feat(mobile): improve date formatting (#1804)

This commit is contained in:
Michel Heusschen
2023-02-20 18:23:00 +01:00
committed by GitHub
parent e408e8ca4a
commit 88a2966666
7 changed files with 14 additions and 55 deletions

View File

@@ -123,9 +123,9 @@ class AlbumViewerPage extends HookConsumerWidget {
final DateTime startDate = album.assets.first.fileCreatedAt;
final DateTime endDate = album.assets.last.fileCreatedAt; //Need default.
final String startDateText =
DateFormat(startDate.year == endDate.year ? 'LLL d' : 'LLL d, y')
(startDate.year == endDate.year ? DateFormat.MMMd() : DateFormat.yMMMd())
.format(startDate);
final String endDateText = DateFormat('LLL d, y').format(endDate);
final String endDateText = DateFormat.yMMMd().format(endDate);
return Padding(
padding: EdgeInsets.only(
@@ -134,7 +134,7 @@ class AlbumViewerPage extends HookConsumerWidget {
bottom: album.shared ? 0.0 : 8.0,
),
child: Text(
"$startDateText-$endDateText",
"$startDateText - $endDateText",
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,