taitems / jQuery.Gantt

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

Problem With Dates #225

Closed pnigroh closed 5 years ago

pnigroh commented 5 years ago

Hi,

I really don't understand the way the dates work on this plugin.

Is this supposed to use a javascript timestamp? I get really different values when attempting to do so.

For instance in the index.html the first example data is the following:

{ name: "Sprint 0", desc: "Analysis", values: [{ from: 1320192000000, to: 1322401600000, label: "Requirement Gathering", customClass: "ganttRed" }] }

On the GANTT chart I see this event starts in Nov. 28, 2018. But when I try to get a timestamp for this date I get 1543449600000 in milliseconds, for instance using TimeStampConvert.

I don't understand this huge difference in values. Are you using milliseconds since 1970/01/01 as the value?

Please help me with this. I found no similar threads to this problem. On the example I see you use '2019-01-12' as an alternative but this seems not to work as well.

Thank you!

usmonster commented 5 years ago

Hello @pnigroh! Thanks for opening the issue.

Yes, the date formats in this plugin include the standard JS timestamp and some others, all of which are documented further down in index.html.

The code you see in the index.html example has additional logic to dynamically adjust the demo dates to something closer to "today" (see #219, #104), so it won't work for you as expected if you just copy-paste.

I hope this answers your questions, and thanks again for using the plugin! Closing this issue now.

pnigroh commented 5 years ago

I really appreciate the answer. My whole problem was with you adjusting the demo dates to something closer to today. I removed this and the whole problem was done. Thank you for the great work!