inaturalist / iNaturalistReactNative

Cross-platform version of the iNat mobile app
MIT License
71 stars 25 forks source link

Show time zone whenever showing time_observed_at #2252

Open angielt opened 1 month ago

angielt commented 1 month ago

Currently time is displayed to capture precise moment. It would be preferred if the observation time represented the time zone the observation was made. (i.e. 7:20am ECT than 5:20am (unspecified but actually PDT)

Request from Carrie

Ver 0.50.0

abhasinat commented 3 weeks ago

This should be handled the same way we do on web any time we show time observed OR time submitted.

Here are some examples:

Obs edit: Image

Obs Detail: Image

tobias47n9e commented 2 weeks ago

I could work on this and have already looked into it.

Currently the translations manage the format of the displayed timestamps. Appending a z to all those string would show the timezone:

# de.ftl
datetime-format-long = dd. MMMM yyyy HH:mm z
datetime-format-short = dd. MM.yy,  HH:mm z

image

It would also be possible to append the z for all languages in e.g. formatApiDatetime(), but not sure if that is the correct solution for all languages.

abhasinat commented 2 weeks ago

@kueda any guidance on how to approach it?

kueda commented 2 weeks ago

date-fns supports multiple time zone tags so how that gets formatted should be left up to the translators. FWIW, part of the requirement is to show the location-specific time zone codes if that's what translators want, so here in California we should see PST, not GMT-8.