automatic change to next year

Help with installation and general calendar setttings

automatic change to next year

Postby willem » Wed Nov 23, 2011 1:17 pm

Hello Chris.
I have an question. I'm not an developer that's why I'm very glad with this forum and your calendar. The way I'm using it, is this way, I show 6 months, (may, June, July, august, September, October) when you use the next arrow button, the calendar goes to next year, it then shows the 6 months for next year. The question is this, is it possible ( November now ) that de calendar in November (November is not shown) with some changes, automatically changes to next year? I have found a lot but this question I could not find. I hope you can help me, if not, I will survive and your calendar will still work fine.
Many regards
Willem
http://www.ontspannenopvakantie.nl/cale ... =1&lang=nl
User avatar
willem
 
Posts: 5
Joined: Mon Nov 21, 2011 1:23 pm

Re: automatic change to next year

Postby chris » Wed Nov 23, 2011 4:10 pm

Hi Willem,
Basically you need to do a check in the ac-includes > cal.inc.php file where the code defines the first month to show.
Currently you have something like this as you ahve modified it to start in May:
Code: Select all
$this_year      =   date('Y');
$this_month   =   5;

(I would need to dig out the forum post that you used to modify this for the exact syntax).

You need to add a check in there to check the current month and, if it is greater than 10 (October) move the year forward by one.
SOmething like this :

Code: Select all
$this_year      =   date('Y');
$this_month   =   5;
if(date('m')>10) $this_year=$this_year+1;


I have not tested that code but hopefully it should point you in the right direction :)
Let me know if it doesn't work and how it goes in general.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: automatic change to next year

Postby willem » Wed Nov 23, 2011 5:34 pm

Hello Chris,
What you suggested works exactly as I wanted it, you put your finger precisely on the right spot. :D
Thanks very much,
Willem
User avatar
willem
 
Posts: 5
Joined: Mon Nov 21, 2011 1:23 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron