immich icon indicating copy to clipboard operation
immich copied to clipboard

fix(mobile): display original creation date

Open juaoose opened this issue 1 year ago • 8 comments

Description

This PR attempts to match the dates displayed on the mobile application with the web application. Currently, the web application shows the original creation date, where the mobile application shows the date adjusted to the device's locale.

Current Web Current Mobile
image image

With this change the dates displayed on both platforms would essentially display the same information (this PR's main focus is not to match the exact format)

image

How Has This Been Tested?

This was manually tested with multiple photos taken in a different time zone.

Edit: Widget tests were also added.

Screenshots (if appropriate):

image

Checklist:

  • [x] I have performed a self-review of my own code
  • [x] I have made corresponding changes to the documentation if applicable. N/A

juaoose avatar Jun 16 '23 23:06 juaoose

Deployment failed with the following error:

Resource is limited - try again in 10 minutes (more than 100, code: "api-deployments-free-per-day").

vercel[bot] avatar Jun 16 '23 23:06 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2023 3:50am

vercel[bot] avatar Jun 16 '23 23:06 vercel[bot]

I don't think I have a solid idea on how to handle the "UTC+2" timezone format...

juaoose avatar Jun 17 '23 02:06 juaoose

Without resolving issue with UTC+/-x, I don't think this PR can be merged because we will have instance of local time is correct but then the displayed timezone will be incorrect.

alextran1502 avatar Jun 17 '23 13:06 alextran1502

Without resolving issue with UTC+/-x, I don't think this PR can be merged because we will have instance of local time is correct but then the displayed timezone will be incorrect.

I agree, I think it might be doable but it would pretty much be like: grab that local date we get from Isar, add() or substract() time based on the provided string UTC+/- and then just build the "GMT+-X" string manually.

Looks like the only way to do it with DateTime, since it only supports either the date being at the current locale or at UTC.

That solution might also fail with DST and such time intricacies... although I'm not sure we can avoid them without only using IANA codes instead of offsets.

Any ideas are welcome :)

juaoose avatar Jun 17 '23 16:06 juaoose

do you have update on this pr?

alextran1502 avatar Jul 01 '23 04:07 alextran1502

Hello any news on the implementation to cover all cases?

alextran1502 avatar Jul 09 '23 02:07 alextran1502

Hello any news on the implementation to cover all cases?

Sorry for the delay, I think both cases are properly handled now.

juaoose avatar Jul 10 '23 03:07 juaoose

Superseded by #4774

alextran1502 avatar Nov 03 '23 14:11 alextran1502