CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fortnightly events

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related
View previous topic :: View next topic  
Author Message
colnrita



Joined: 26 Sep 2007
Posts: 8
Location: Darkest SW Australia

PostPosted: Sun Sep 30, 2007 8:21 am    Post subject: Fortnightly events Reply with quote

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
View user's profile Send private message Visit poster's website
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Sun Sep 30, 2007 4:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
colnrita



Joined: 26 Sep 2007
Posts: 8
Location: Darkest SW Australia

PostPosted: Tue Oct 02, 2007 5:50 am    Post subject: Reply with quote

Thanks- managed to get this working (MILLIDAY isn't defined in all of your examples)

Colin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> FlatCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group