mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server,web,mobile): Incorrectly record and show timestamp and time zone of the asset (#706)
Implemented a mechanism to extract the correct time zone from the GPS coordinate if presented in the file's EXIF, and to convert the timestamp to the correct UTC time so that the time will show correctly based on the mobile/web local time zone.
This commit is contained in:
parent
fc194021a4
commit
e5459b68ff
16 changed files with 392 additions and 63 deletions
|
|
@ -81,7 +81,7 @@ class ExifBottomSheet extends ConsumerWidget {
|
|||
if (assetDetail.exifInfo?.dateTimeOriginal != null)
|
||||
Text(
|
||||
DateFormat('date_format'.tr()).format(
|
||||
assetDetail.exifInfo!.dateTimeOriginal!,
|
||||
assetDetail.exifInfo!.dateTimeOriginal!.toLocal(),
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Colors.grey[400],
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ class BackupControllerPage extends HookConsumerWidget {
|
|||
DateTime.parse(
|
||||
backupState.currentUploadAsset.createdAt
|
||||
.toString(),
|
||||
),
|
||||
).toLocal(),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class FailedBackupStatusPage extends HookConsumerWidget {
|
|||
DateFormat.yMMMMd('en_US').format(
|
||||
DateTime.parse(
|
||||
errorAsset.createdAt.toString(),
|
||||
),
|
||||
).toLocal(),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ class DailyTitleText extends ConsumerWidget {
|
|||
var formatDateTemplate = currentYear == groupYear
|
||||
? "daily_title_text_date".tr()
|
||||
: "daily_title_text_date_year".tr();
|
||||
var dateText =
|
||||
DateFormat(formatDateTemplate).format(DateTime.parse(isoDate));
|
||||
var dateText = DateFormat(formatDateTemplate)
|
||||
.format(DateTime.parse(isoDate).toLocal());
|
||||
var isMultiSelectEnable =
|
||||
ref.watch(homePageStateProvider).isMultiSelectEnable;
|
||||
var selectedDateGroup = ref.watch(homePageStateProvider).selectedDateGroup;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class MonthlyTitleText extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var monthTitleText = DateFormat("monthly_title_text_date_format".tr())
|
||||
.format(DateTime.parse(isoDate));
|
||||
.format(DateTime.parse(isoDate).toLocal());
|
||||
|
||||
return SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ final searchResultGroupByDateTimeProvider = StateProvider((ref) {
|
|||
(a, b) => b.compareTo(a),
|
||||
);
|
||||
return assets.groupListsBy(
|
||||
(element) =>
|
||||
DateFormat('y-MM-dd').format(DateTime.parse(element.createdAt)),
|
||||
(element) => DateFormat('y-MM-dd')
|
||||
.format(DateTime.parse(element.createdAt).toLocal()),
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue