View previous topic :: View next topic |
Author |
Message |
nickand
Joined: 13 Mar 2005 Posts: 8
|
Posted: Sat Apr 23, 2005 9:07 am Post subject: Can I give agenda a range of dates? |
|
|
Hi,
I have a php agenda file which works great with the holiday function. But is there a simple function either in java or php that I can provide it with a range of dates to show as one holiday?
For example 5th June - 12th August? At the moment I have 3 if statements for each month.
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Sat Apr 23, 2005 4:08 pm Post subject: |
|
|
Well, you may use the following code to translate php date range into a holiday:
Code: | function fHoliday(y,m,d) {
...
var startDate=new Date(y, <?= phpVarStartMonth ?>-1, <?= phpVarStartDate ?>);
var endDate=new Date(y, <?= phpVarEndMonth ?>-1, <?= phpVarEndDate ?>);
var curDate=new Date(y, m-1, d);
if (startDate<=curDate&&curDate<=endDate)
return ["my holiday", null];
...
} |
The phpVarXXX variables are defined in your php page.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
nickand
Joined: 13 Mar 2005 Posts: 8
|
Posted: Sat Apr 23, 2005 6:04 pm Post subject: |
|
|
Hey Thanks. That works great. I just had to add $ to the beginning of my variables. Thanks for the quick reply.
|
|
Back to top |
|
|
|