avniproject / avni-models

Avni data model to be used by front end clients
https://avniproject.org
GNU Affero General Public License v3.0
1 stars 4 forks source link

Processing based on time zone #53

Open mahalakshme opened 2 months ago

mahalakshme commented 2 months ago

Steps:

AC:

Need:

The above is needed because as per the implementation team, the conversion doesn't happen. Identifying where we are doing the above, will help us to identify if any edge cases exist, that needs to be fixed.

Old: Ignore

Have a configuration - of country somewhere

Image

Inputs:

petmongrels commented 1 week ago

https://gist.github.com/sachsk/e7a9e9b6e666aca4ffc99403a280d533

petmongrels commented 1 week ago

our dates are like "2024-03-23T06:08:45.000Z" in the offline db. Using Z in the timestamp means UTC. When we display the date using console.log we are shown the date in human friendly timezone converted format. Check this link for more on date being initialised with string - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format

There is no issue in Avni mobile wrt to date being in UTC

mahalakshme commented 1 week ago

@petmongrels where is the conversion happening? How does it know it needs to convert to IST?

petmongrels commented 6 days ago

The timezone comes from the JS runtime environment. It is just the display that is changed. We can use sensors feature to test this out. Same date will be shown differently by changing the geolocation - https://www.youtube.com/watch?v=pIpN_AuV4AI