xuanngo2001 / jsgantt

Automatically exported from code.google.com/p/jsgantt
0 stars 0 forks source link

Open Gantt Chart to Current Date #82

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output?
Is there some way to have the Gantt Chart scroll to the current date when
first opening the web page instead of having the left side of the chart
align to the earliest task date?

Are there any specific API changes you would like to see?

Please provide any additional information below.

Original issue reported on code.google.com by glopa...@coh.org on 11 May 2010 at 9:57

GoogleCodeExporter commented 8 years ago
glopatin, did you ever figure out how to do this?

Original comment by johnatha...@b-f.com on 18 Apr 2012 at 8:16

GoogleCodeExporter commented 8 years ago
No, not yet.

Original comment by glopa...@coh.org on 19 Apr 2012 at 12:04

GoogleCodeExporter commented 8 years ago
Any update on this?

Original comment by ushadevi...@gmail.com on 23 Jul 2013 at 10:08

GoogleCodeExporter commented 8 years ago
I haven't tested this against the hour or day formats but based on the rest of 
the code this ought to work if inserted at line 997:

if(vFormat=='minute')vTaskLeft = Math.ceil(new Date() - Date.parse(vMinDate)) / 
( 60 * 1000);
else if(vFormat=='hour')vTaskLeft = (new Date() - Date.parse(vMinDate)) / ( 60 
* 60 * 1000);
else vTaskLeft = Math.ceil(new Date() - Date.parse(vMinDate)) / (24 * 60 * 60 * 
1000);

JSGantt.findObj('rightside').scrollLeft=Math.ceil((vTaskLeft * (vDayWidth) + 
1));

Original comment by jsgantt.improved on 13 Dec 2014 at 7:28