mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
Correctly show current backup asset date when createdAt is in the year of 1970
This commit is contained in:
parent
171ba84741
commit
3aab8ccb4a
@ -274,7 +274,9 @@ class BackupService {
|
||||
setCurrentUploadAssetCb(
|
||||
CurrentUploadAsset(
|
||||
id: entity.id,
|
||||
createdAt: entity.createDateTime,
|
||||
createdAt: entity.createDateTime.year == 1970
|
||||
? entity.modifiedDateTime
|
||||
: entity.createDateTime,
|
||||
fileName: originalFileName,
|
||||
fileType: _getAssetType(entity.type),
|
||||
),
|
||||
|
@ -468,6 +468,14 @@ class BackupControllerPage extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
buildCurrentBackupAssetInfoCard() {
|
||||
String getAssetCreationDate() {
|
||||
return DateFormat.yMMMMd('en_US').format(
|
||||
DateTime.parse(
|
||||
backupState.currentUploadAsset.createdAt.toString(),
|
||||
).toLocal(),
|
||||
);
|
||||
}
|
||||
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
Icons.info_outline_rounded,
|
||||
@ -576,14 +584,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
||||
fontSize: 10.0,
|
||||
),
|
||||
).tr(
|
||||
args: [
|
||||
DateFormat.yMMMMd('en_US').format(
|
||||
DateTime.parse(
|
||||
backupState.currentUploadAsset.createdAt
|
||||
.toString(),
|
||||
).toLocal(),
|
||||
)
|
||||
],
|
||||
args: [getAssetCreationDate()],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user