mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-10 07:21:04 +01:00
Anything longer than 3 days is shown as Month + Day
This commit is contained in:
parent
69f6668d05
commit
60c2566bf9
@ -316,11 +316,40 @@ var et2_gantt = et2_valueWidget.extend([et2_IResizeable,et2_IInput],
|
|||||||
|
|
||||||
this.parse(safe_value);
|
this.parse(safe_value);
|
||||||
|
|
||||||
|
gantt_widget.gantt_loading = false;
|
||||||
// Once we force the start / end date (below), gantt won't recalculate
|
// Once we force the start / end date (below), gantt won't recalculate
|
||||||
// them if the user clears the date, so we store them and use them
|
// them if the user clears the date, so we store them and use them
|
||||||
// if the user clears the date.
|
// if the user clears the date.
|
||||||
//gantt_widget.stored_state = jQuery.extend({},this.getState());
|
//gantt_widget.stored_state = jQuery.extend({},this.getState());
|
||||||
|
|
||||||
|
// Doing this again here forces the gantt chart to trim the tasks
|
||||||
|
// to fit the date range, rather than drawing all the dates out
|
||||||
|
// to the start date.
|
||||||
|
// No speed improvement, but it makes a lot more sense in the UI
|
||||||
|
var range = this.attachEvent('onGanttRender', function() {
|
||||||
|
this.detachEvent(range);
|
||||||
|
if(value.start_date || value.end_date)
|
||||||
|
{
|
||||||
|
// TODO: Some weirdness in this when changing dates
|
||||||
|
// If this is done, gantt does not respond when user clears the start date
|
||||||
|
/*
|
||||||
|
this.refreshData();
|
||||||
|
debugger;
|
||||||
|
if(gantt_widget.getWidgetById('start_date') && new Date(value.start_date) > this._min_date)
|
||||||
|
{
|
||||||
|
gantt_widget.getWidgetById('start_date').set_value(value.start_date || null);
|
||||||
|
}
|
||||||
|
if(gantt_widget.getWidgetById('end_date') && new Date(value.end_date) < this._max_date)
|
||||||
|
{
|
||||||
|
gantt_widget.getWidgetById('end_date').set_value(value.end_date || null);
|
||||||
|
}
|
||||||
|
this.refreshData();
|
||||||
|
this.render();
|
||||||
|
*/
|
||||||
|
|
||||||
|
this.scrollTo(this.posFromDate(new Date(value.end_date || value.start_date )),0);
|
||||||
|
}
|
||||||
|
|
||||||
// Zoom to specified or auto level
|
// Zoom to specified or auto level
|
||||||
var auto_zoom = this.attachEvent('onGanttRender', function() {
|
var auto_zoom = this.attachEvent('onGanttRender', function() {
|
||||||
this.detachEvent(auto_zoom);
|
this.detachEvent(auto_zoom);
|
||||||
@ -328,32 +357,12 @@ var et2_gantt = et2_valueWidget.extend([et2_IResizeable,et2_IInput],
|
|||||||
this.render();
|
this.render();
|
||||||
this.hideCover();
|
this.hideCover();
|
||||||
|
|
||||||
// Doing this again here forces the gantt chart to trim the tasks
|
|
||||||
// to fit the date range, rather than drawing all the dates out
|
|
||||||
// to the start date.
|
|
||||||
// No speed improvement, but it makes a lot more sense in the UI
|
|
||||||
if(value.start_date || value.end_date)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
// TODO: Some weirdness in this when changing dates
|
|
||||||
if(gantt_widget.getWidgetById('start_date') && value.start_date > gantt_widget.stored_state._min_date)
|
|
||||||
{
|
|
||||||
gantt_widget.getWidgetById('start_date').set_value(value.start_date || null);
|
|
||||||
}
|
|
||||||
if(gantt_widget.getWidgetById('end_date') && value.end_date < gantt_widget.stored_state._max_date)
|
|
||||||
{
|
|
||||||
gantt_widget.getWidgetById('end_date').set_value(value.end_date || null);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
this.scrollTo(this.posFromDate(new Date(value.end_date || value.start_date )),0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(console.timeEnd) console.timeEnd("Gantt set_value");
|
if(console.timeEnd) console.timeEnd("Gantt set_value");
|
||||||
if(console.groupEnd) console.groupEnd();
|
if(console.groupEnd) console.groupEnd();
|
||||||
if(console.profile) console.profileEnd();
|
if(console.profile) console.profileEnd();
|
||||||
});
|
});
|
||||||
gantt_widget.gantt_loading = false;
|
});
|
||||||
})
|
});
|
||||||
this.gantt.render();
|
this.gantt.render();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -444,8 +453,8 @@ var et2_gantt = et2_valueWidget.extend([et2_IResizeable,et2_IInput],
|
|||||||
{
|
{
|
||||||
level = 4;
|
level = 4;
|
||||||
}
|
}
|
||||||
// More than 2 months
|
// More than 3 days
|
||||||
else if(difference > 5256000 || this.gantt.getState().max_date.getMonth() != this.gantt.getState().min_date.getMonth())
|
else if(difference > 86400 * 3 || this.gantt.getState().max_date.getMonth() != this.gantt.getState().min_date.getMonth())
|
||||||
{
|
{
|
||||||
level = 3;
|
level = 3;
|
||||||
}
|
}
|
||||||
@ -454,6 +463,7 @@ var et2_gantt = et2_valueWidget.extend([et2_IResizeable,et2_IInput],
|
|||||||
{
|
{
|
||||||
level = 2;
|
level = 2;
|
||||||
}
|
}
|
||||||
|
// Less than a day
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
level = 1;
|
level = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user