mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Align planner view to weeks
This commit is contained in:
parent
e4a0808693
commit
932fcbc78c
@ -3582,11 +3582,18 @@ jQuery.extend(app.classes.calendar,{
|
|||||||
{
|
{
|
||||||
return state.first;
|
return state.first;
|
||||||
}
|
}
|
||||||
|
// Start here, in case we can't find anything better
|
||||||
var d = app.calendar.View.start_date.call(this, state);
|
var d = app.calendar.View.start_date.call(this, state);
|
||||||
|
|
||||||
if(state.sortby && state.sortby === 'month' ||
|
if(state.sortby && state.sortby === 'month' ||
|
||||||
[28,30,31].indexOf(state.planner_days||0) >= 0)
|
[28,30,31].indexOf(state.planner_days||0) >= 0)
|
||||||
{
|
{
|
||||||
d.setUTCDate(1);
|
d = app.classes.calendar.views.month.start_date.call(this,state);
|
||||||
|
}
|
||||||
|
else if (state.planner_days % 7 == 0)
|
||||||
|
{
|
||||||
|
// Week
|
||||||
|
d = app.classes.calendar.views.week.start_date.call(this,state);
|
||||||
}
|
}
|
||||||
else if (state.days)
|
else if (state.days)
|
||||||
{
|
{
|
||||||
@ -3640,11 +3647,17 @@ jQuery.extend(app.classes.calendar,{
|
|||||||
if([28,30,31].indexOf(state.planner_days||0) >= 0)
|
if([28,30,31].indexOf(state.planner_days||0) >= 0)
|
||||||
{
|
{
|
||||||
// Month view
|
// Month view
|
||||||
d = new Date(d.getFullYear(),d.getUTCMonth() + 1, 0);
|
d = app.classes.calendar.views.month.end_date.call(this,state);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
d = new Date(state.first);
|
||||||
d.setUTCDate(d.getUTCDate() + parseInt(state.planner_days)-1);
|
d.setUTCDate(d.getUTCDate() + parseInt(state.planner_days)-1);
|
||||||
|
if (state.planner_days % 7 == 0)
|
||||||
|
{
|
||||||
|
// Week
|
||||||
|
d = app.calendar.date.end_of_week(d);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete state.planner_days;
|
delete state.planner_days;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user