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

Mixing times from before and after 2001 breaks #228

Open
hansthen opened this issue Apr 14, 2024 · 1 comment
Open

Mixing times from before and after 2001 breaks #228

hansthen opened this issue Apr 14, 2024 · 1 comment

Comments

@hansthen
Copy link

When providing a GeoJson that has dates from before and after 2001-09-09 the Timedimension breaks.

This issue was originally discovered and reported when using the Folium package: see python-visualization/folium#1268 for more background.

The issue may be related to the fact that during 2001-09-09 an extra digit was added in the unix timestamp.

User @davecao suggests the following fix:

In the function sort_and_deduplicate change the line arr = arr.slice(0).sort() to arr = arr.slice(0).sort(function(a, b){return a-b;});

@hansthen
Copy link
Author

hansthen commented Apr 14, 2024

The issue seems to be resolved in source code, but not yet published to the CDN. See
https://cdn.jsdelivr.net/npm/[email protected]/src/leaflet.timedimension.util.js, which does not have the suggested changes. Would it be possible to release the latest version of the code to CDN?

See git blame, which was made a few days after the 1.1.1 release.

de8e568c (Amir Livne Bar-on 2017-12-02 14:00:16 +0200 200)     sort_and_deduplicate: function(arr) {
8403a32a (Biel Frontera     2019-11-19 16:44:53 +0100 201)         arr = arr.slice(0).sort(function (a, b) {
8403a32a (Biel Frontera     2019-11-19 16:44:53 +0100 202)             return a - b;
8403a32a (Biel Frontera     2019-11-19 16:44:53 +0100 203)         });

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

No branches or pull requests

1 participant