@stephenharris: Thanks for a great plugin.
@blazeking and @kwida:
I just wanted to share with you my findings regarding
a likely reason for the cluttered agenda widget list in the ‘week’ or ‘month’ mode.
I selected the ‘week’ mode and then dug through the code and found that the group_change()
method only works for the ‘day’ mode.
I’m not sure though why this mode restriction is added?
Here’s the relevant part from the frontend.js
file:
eventorganiser.agenda_widget.prototype.group_change = function( previous, current ){
if( previous === false ){
return true;
}
//------------------------------------------------------------
// This check is doesn't work well in 'week' or 'month' mode
if( this.param.mode !== 'day' ){
return false;
}
//------------------------------------------------------------
return previous.format( 'YYYY-MM-DD' ) !== current.format( 'YYYY-MM-DD' );
};
The inline comment is added by myself for clarification.
I wouldn’t recommend modifying the plugin files though.
Hope this helps.