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

Broken on 30.10.22 when passing from sommer to winter time #113

Closed
kevinleto-informaticon opened this issue Nov 3, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@kevinleto-informaticon
Copy link

kevinleto-informaticon commented Nov 3, 2022

Hi guys, I've noticed that the Gantt doesn't work fine from 30.10.22 when we switched from the summertime to the winter one (-1 hour).

The calendar shows two times the 30th instead of the 31st + a small portion of the 1st of November.
image

This causes all tasks after the 30th, to be either not displayed or wrongly positioned on the row.
Here is how I set the time range in Gantt:

let october30: Moment = moment("2022-10-30", "YYYY-MM-DD").startOf('day');
let october31: Moment = moment("2022-10-31", "YYYY-MM-DD").endOf('day');
let dayCount = Math.abs(october31.diff(october30, 'day')) + 1;

gantt.$set({
  from: october30.valueOf(),
  to: october31.valueOf(),
  minWidth: dayCount * 20
});

I would expect that the Gantt shows the 30th and the 31st completely (without the portion of the 1st of November).

Can you please help me to solve the problem?
Thanks a lot for the help 🙏

PS: this problem occurs each time we pass from summertime to winter one (on 28 March 2021 I become the same problem). Not sure if it also happens in the opposite direction. I've started using the library some months ago.
I use the new version of the lib "svelte-gantt": "~4.0.9-beta"

@kevinleto-informaticon
Copy link
Author

Something similar happens also in the demo.
When setting the dates in the Nav component, Gantt shows two times the 30th and then goes ahead with 31st, 1st, 2nd, and so on.
image

I've tested it with the v4.0.7-beta, as the new version cannot be started see this issue.

@kevinleto-informaticon
Copy link
Author

kevinleto-informaticon commented Nov 3, 2022

Edit:
I think the error is here as the 30th has a duration of 25 (24+1) hours and not 24.

The bug is not present in the v3.0.4-beta.

@kevinleto-informaticon kevinleto-informaticon changed the title Broken after 30.10.22 when passing from sommer to winter time Broken on 30.10.22 when passing from sommer to winter time Nov 3, 2022
@V-Py V-Py added the bug Something isn't working label Nov 13, 2022
@V-Py
Copy link
Collaborator

V-Py commented Nov 13, 2022

Will look at it asap, but if you find any corrections you might as well do a PR so I can integrate it way faster

@V-Py
Copy link
Collaborator

V-Py commented Jan 4, 2023

Should be fixed since #136

@V-Py V-Py closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants