taitems / jQuery.Gantt

jQuery Gantt Chart
http://taitems.github.io/jQuery.Gantt/
MIT License
952 stars 304 forks source link

Graphic Problem #221

Closed LuigiMdg closed 5 years ago

LuigiMdg commented 6 years ago

Hi.. Today I've this problem..! (May is on new line) Link to Image This using original js and css

usmonster commented 6 years ago

Hello! Thanks for reporting this. Can you please provide a JSFiddle that reproduces the problem?

LuigiMdg commented 6 years ago

I've found the problem.. February is displayed, with width of 0px, but they deal 1px.. If I take a css display:none it's ok Link to HTML and CSS

Here's a demo of the problem: https://donagest.com/test/

usmonster commented 6 years ago

Thanks for the test. You're right—it looks like a problem in the header rendering logic for the "days" scale.

For some reason unclear to me, there's an extra day prepended to the header's range, which causes this issue on specific dates in the beginning of each month. I think it was added to compensate for another workaround introduced 5 years ago. Maybe @kripper or @taitems can comment?

In any case, I just put up a potentially cleaner, moderately-tested fix for this along with some long-standing DST-related issues (#95, #41) on my personal branch. Please take a look and test to see if it works for you, and I'll make a PR & eventually merge it to the official source.

LuigiMdg commented 6 years ago

No.. The problem isn't a extra day.. The problem is February that have width = 0px.. If you can delete the print of the months with 0 pixels they work correctly

usmonster commented 6 years ago

I'll clarify what I mean—there's some strange logic that compares the chart's range with the "day before" its actual start. These comparisons to a seemingly irrelevant day can cause an extra month or year header cell to appear, even if no day in the range is part of the month/year.

@LuigiMdg, can you please test if my fix—which removes this extra month—works for you by using this file? Thanks in advance!

LuigiMdg commented 6 years ago

Today it work without use your file..! :( I wait next time error to try your updated file..

LuigiMdg commented 6 years ago

The problem has finally arisen ..! I made a video of how I would solve it .. Simply, when the width is equal to zero, you should avoid giving the output .. Alternatively, a display could be set to none Click for Video

usmonster commented 6 years ago

Hello again! :)

As I mentioned in my previous two comments, I've already made a potential fix for this issue.

Can you please test it by temporarily loading this file in your page instead of the official one from this repository, and then tell me if it works for you?

Alternatively, you can play around with this JSFiddle, which demonstrates the fix: https://jsfiddle.net/xpvt214o/46353/

Please let me know if there are any unwanted side effects of my fix, and I'll update it. Otherwise, if it works, I'll make a pull request and get it merged into the official plug-in right away.

Thanks again for reporting this!

LuigiMdg commented 6 years ago

I could not explain why copying the code generated on the test page could not reproduce the problem .. I know so much that it was your fix that adjusted everything ..! Now it is gone, but as soon as it appears again I try to load it and I can confirm if the problem is solved :+1:

usmonster commented 5 years ago

I finally put my fix into a pull request: #226.

Please feel free to review it and test it out!

This issue will be closed once it's merged.

usmonster commented 5 years ago

226 was merged, so I'm closing this. :)