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 

looping thru selected dates

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



Joined: 30 May 2008
Posts: 8

PostPosted: Tue Oct 07, 2008 7:14 pm    Post subject: looping thru selected dates Reply with quote

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


Joined: 30 Jan 2005
Posts: 409

PostPosted: Wed Oct 08, 2008 7:41 pm    Post subject: Reply with quote

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