fix(mobile): incorrect date range (#4644)

* fix(mobile): incorrect date range

* remove comment

* pr feedback
This commit is contained in:
Alex
2023-10-25 16:56:31 -05:00
committed by GitHub
parent cf71a41bae
commit 237d1c1bf4
3 changed files with 264 additions and 25 deletions

View File

@@ -164,8 +164,13 @@ class AlbumViewerPage extends HookConsumerWidget {
}
Widget buildAlbumDateRange(Album album) {
final DateTime startDate = album.assets.first.fileCreatedAt;
final DateTime endDate = album.assets.last.fileCreatedAt; //Need default.
final DateTime? startDate = album.startDate;
final DateTime? endDate = album.endDate;
if (startDate == null || endDate == null) {
return const SizedBox();
}
final String startDateText = (startDate.year == endDate.year
? DateFormat.MMMd()
: DateFormat.yMMMd())