Hi Jabber.
I see it exactly like davidm: we are here to post our experiences to help you improve that snippet more and more.
Here we go with an issue I just found: In the [tt]navPeriod[/tt] DIV we have a problem.
When I currently look at December 2007, the arrow’s link for next month contains "[tt]mois=13&annee=2007[/tt]". This leads to a misbehaviour, I get redirected to September (current month) 2007.
When I currently look at January 2008 (I got there by clicking the "next year" button and going back from September through February and January), the arrow’s link for previous month contains "[tt]mois=0&annee=2008[/tt]". This brings me to September (current month) 2008.
Okay, as time passes, I "fixed" that. function createNavBar now starts with
$navMonth="";
$output='<div class=\'CALxContent'.$this->chunkCSSID.'\'>'."\n";
$previousYear=$this->annee-1;
$previousMonth=$this->mois-1;
$previousMonthYear = $this->annee; // used for changes on year's start and end
if($previousMonth == 0){
$previousMonth = 12;
$previousMonthYear--;
}
$nextMonthYear = $this->annee; // used for changes on year's start and end
$nextMonth=$this->mois+1;
$nextYear=$this->annee+1;
if($nextMonth == 13){
$nextMonth=1;
$nextMonthYear++;
}
and the output for the navigation row now looks like that (only two little changes to no longer output the current year on month change but the corrected month and year):
if($this->getTypeProcess!='showFullYear'){
$output.='<div class=\'navPeriod'.$this->chunkCSSID.'\'>'."\n";
$output.='<span class=\'previousYear'.$this->chunkCSSID.'\'><a href="'.$this->url_prefix.$strDayLink.'&mois='.($this->mois).'&annee='.$previousYear.'" title="'.$this->previousYear.'"><<</a></span>'."\n";
$output.='<span class=\'previousMonth'.$this->chunkCSSID.'\'><a href="'.$this->url_prefix.$strDayLink.'&mois='.$previousMonth.'&annee='.$previousMonthYear.'" title="'.$this->previousMonth.'"><</a></span>'."\n";
$output.='<span class=\'month'.$this->chunkCSSID.'\'>'.$this->month[$this->mois-1].'</span>'."\n";
$output.='<span class=\'year'.$this->chunkCSSID.'\'>'.$this->annee.'</span>'."\n";
$output.='<span class=\'nextMonth'.$this->chunkCSSID.'\'><a href="'.$this->url_prefix.$strDayLink.'&mois='.$nextMonth.'&annee='.$nextMonthYear.'" title="'.$this->nextMont.'">></a></span>'."\n";
$output.='<span class=\'nextYear'.$this->chunkCSSID.'\'><a href="'.$this->url_prefix.$strDayLink.'&mois='.($this->mois).'&annee='.$nextYear.'" title="'.$this->nextYear.'">>></a></span>'."\n";
$output.='</div>'."\n";//End of navPeriod
}else{
BTW: I hope it’s okay when I post all this stuff here
Greetings
Martin