|
CalendarXP.net Support Most forums here are private and invisible to public.
|
View previous topic :: View next topic |
Author |
Message |
vipinc
Joined: 30 May 2008 Posts: 8
|
Posted: Tue Oct 07, 2008 7:14 pm Post subject: looping thru selected dates |
|
|
Hi,
Following is my implementation of the FlatCalendar :
http://malabarhouse.com/newmalabar/trinity.php
When 2 dates are selected , I want to loop thru the dates and chk the events in each date, so as to perform certain action.
Can you pls tell how to do this?
Thanks,
Vipin
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Wed Oct 08, 2008 7:41 pm Post subject: |
|
|
To get the event of a certain date, you just need to call fGetAgenda(y,m,d).
To loop through dates, you may need the following function:
Code: | function loop(start_date, end_date) {
var cursor=start_date;
while (cursor<=end_date) {
// extract y,m,d from a date object to ensure validity.
var y=cursor.getFullYear();
var m=cursor.getMonth();
var d=cursor.getDate();
// do anything you like after retrieving the event........
var evt=fGetAgenda(y,m+1,d);
// now increase cursor date, note the date object will correct itself if the value d goes over the max date of a month.
cursor= new Date(y,m,d+1);
}
} |
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
|
|
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
|