Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong date on map tooltip-photo-date #807

Closed
adripo opened this issue Jul 31, 2022 · 4 comments · Fixed by #808
Closed

Wrong date on map tooltip-photo-date #807

adripo opened this issue Jul 31, 2022 · 4 comments · Fixed by #808

Comments

@adripo
Copy link
Contributor

adripo commented Jul 31, 2022

Hi, I am having an issue with the dates shown on the map tooltip. It is always somewhere close to 1970:

image on map

image

The image date creation is correct if I search in the files details:

image details

image

The time shown on the time filter slider is correct:

time slider

image

@adripo
Copy link
Contributor Author

adripo commented Jul 31, 2022

More details:

  • I am using NC23
  • the date is not always the same. Sometimes is 17 January 1970, sometimes 20 January 1970, and the hours changes as well.

I see there are a few places where this is used:
https://github.com/nextcloud/maps/search?q=tooltip-photo-date

Maybe this operation is wrong:
https://github.com/nextcloud/maps/blob/master/src/nonLocalizedPhotosController.js#L183
Why the *1000?
Same here
https://github.com/nextcloud/maps/blob/master/src/photosController.js#L223
and here
https://github.com/nextcloud/maps/blob/master/src/photosController.js#L367

@tacruc
Copy link
Collaborator

tacruc commented Jul 31, 2022

The files you are looking at are out dated and going to be removed #724.

Anyhow I assume the reason for the wrong date is a factor of *1000 missing. This is due to the fact that we work with seconds since Jan 01 1970. (UTC), but the function converting the integer to a proper date string takes millisecond as input.
Therefore it needs a factor of 1000.

@tacruc
Copy link
Collaborator

tacruc commented Jul 31, 2022

return moment(photo.dateTaken).format('LLL')

There is the factor of 1000 missing

@adripo
Copy link
Contributor Author

adripo commented Aug 1, 2022

Ok, I understand the issue. Thanks for solving it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants