kart7990 / virtualpitwall

https://staging.virtualpitwall.com
Other
15 stars 7 forks source link

simTimeOfDay and simDate not properly populated #26

Closed elft3r closed 3 months ago

elft3r commented 5 months ago

Hey @kart7990, I want to add the simulation date and time to the condition component. However, I saw that the values I retrieved via the API were either not populated or wrong. At least the current implementation shows me 1970-01-01T09:11:24.000Z.

Is there something wrong on the API or do I need to handle these values differently?

Thanks, Jochen

kart7990 commented 5 months ago

Hmm, yeah the time is correct and can be extracted from simTimeOfDay, but I'll have to look at why the simDate is null. Ideally there should just be one property for this, not sure why I have it split out at the moment. I'll take a look.

elft3r commented 5 months ago

Ah, yes, the time is correct, sorry about that. Yes, would be nice to have one, then we don't need to do the conversion at the frontend, but I don't now how you get that information from the API.

elft3r commented 4 months ago

Any information on the fix for this?

kart7990 commented 4 months ago

I was having a tough time finding the date, but I found it. It's not in the shared memory file where the time is, it's in the session yaml. I'll work on getting this consolidated to one correctly formatted property (I'll probably just go with unix time).

elft3r commented 4 months ago

Finding the information in the file is always a tricky one 😅 It took me, for example, some time to find the pitstop information. And then you have the data sometimes in different places as well.

Having it as a UNIX timestamp is a good idea. Then, we can format it to the user's liking in the browser.

kart7990 commented 4 months ago

Fixed and deployed! gameDateTime now represents the sim date and time.

image

elft3r commented 4 months ago

Cool, thanks. I will add the information tomorrow.