View previous topic :: View next topic |
Author |
Message |
colnrita
Joined: 26 Sep 2007 Posts: 8 Location: Darkest SW Australia
|
Posted: Sun Sep 30, 2007 8:21 am Post subject: Fortnightly events |
|
|
Is there a way to program a recurrent event as a Holiday (ie with fHoliday() ) if it occurs on a regular interval (eg every two weeks) from a specific anchor date, irrespective of the month or year?
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Sun Sep 30, 2007 4:56 pm Post subject: |
|
|
Yes, it's possible. e.g. adding the following code to agenda.js:
Code: | var _recur_start=new Date(2007, 9-1, 30).getTime(); |
then add the following in the fHoliday() function:
Code: | var delta = Date.UTC(y, m-1, d) - _recur_start;
if ( delta>=0 && (delta % (MILLIDAY * 14))==0)
return ["recurring event", "alert(111)","gold","red"]; |
This will give you recurring events of every 14 days starting from Sept 30, 2007.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
colnrita
Joined: 26 Sep 2007 Posts: 8 Location: Darkest SW Australia
|
Posted: Tue Oct 02, 2007 5:50 am Post subject: |
|
|
Thanks- managed to get this working (MILLIDAY isn't defined in all of your examples)
Colin
|
|
Back to top |
|
|
|