mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix(mobile): incorrect date range (#4644)
* fix(mobile): incorrect date range * remove comment * pr feedback
This commit is contained in:
parent
cf71a41bae
commit
237d1c1bf4
3 changed files with 13 additions and 2 deletions
|
|
@ -164,8 +164,13 @@ class AlbumViewerPage extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildAlbumDateRange(Album album) {
|
Widget buildAlbumDateRange(Album album) {
|
||||||
final DateTime startDate = album.assets.first.fileCreatedAt;
|
final DateTime? startDate = album.startDate;
|
||||||
final DateTime endDate = album.assets.last.fileCreatedAt; //Need default.
|
final DateTime? endDate = album.endDate;
|
||||||
|
|
||||||
|
if (startDate == null || endDate == null) {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
|
||||||
final String startDateText = (startDate.year == endDate.year
|
final String startDateText = (startDate.year == endDate.year
|
||||||
? DateFormat.MMMd()
|
? DateFormat.MMMd()
|
||||||
: DateFormat.yMMMd())
|
: DateFormat.yMMMd())
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ class Album {
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.modifiedAt,
|
required this.modifiedAt,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
this.lastModifiedAssetTimestamp,
|
this.lastModifiedAssetTimestamp,
|
||||||
required this.shared,
|
required this.shared,
|
||||||
});
|
});
|
||||||
|
|
@ -30,6 +32,8 @@ class Album {
|
||||||
String name;
|
String name;
|
||||||
DateTime createdAt;
|
DateTime createdAt;
|
||||||
DateTime modifiedAt;
|
DateTime modifiedAt;
|
||||||
|
DateTime? startDate;
|
||||||
|
DateTime? endDate;
|
||||||
DateTime? lastModifiedAssetTimestamp;
|
DateTime? lastModifiedAssetTimestamp;
|
||||||
bool shared;
|
bool shared;
|
||||||
final IsarLink<User> owner = IsarLink<User>();
|
final IsarLink<User> owner = IsarLink<User>();
|
||||||
|
|
@ -144,6 +148,8 @@ class Album {
|
||||||
modifiedAt: dto.updatedAt,
|
modifiedAt: dto.updatedAt,
|
||||||
lastModifiedAssetTimestamp: dto.lastModifiedAssetTimestamp,
|
lastModifiedAssetTimestamp: dto.lastModifiedAssetTimestamp,
|
||||||
shared: dto.shared,
|
shared: dto.shared,
|
||||||
|
startDate: dto.startDate,
|
||||||
|
endDate: dto.endDate,
|
||||||
);
|
);
|
||||||
a.owner.value = await db.users.getById(dto.ownerId);
|
a.owner.value = await db.users.getById(dto.ownerId);
|
||||||
if (dto.albumThumbnailAssetId != null) {
|
if (dto.albumThumbnailAssetId != null) {
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue