Welcome,
Guest
|
|
Hi,
I am using web2cal in my portal. I was going through the health club demo file given in the web2cal folder to understand how the events are loaded. From what I see the data passed like this events.push(createHealthClubEvent("Yoga Training", 1, "yoga aud", "John Smith", createDateTime(23, 0,-1), createDateTime(23, 30,1), "Yoga is good for health", true, "PENDING", 20, "PT", "2", [], [] )); Most of the relevant data is passed to createHealthClubEven but I don't see date being passed anywhere. So my question is if I have to load an event into the calendar for a particular date how do I do it? Also, can someone please explain createDateTime function? I see that the last argument is number of days, but i shows some negative values being passed. Any help would be highly appreciated. Thanks, Swetha Attachment healthclubdemo.zip not found |
Please Log in to join the conversation.
Last edit: by swetha.
|
|
Hey, you can see the createDateTime function in the sampleData.js
It is a simple utility function. For your convenience I have pasted the function here
function createDateTime(ti, h, numofDays)
{
var dd = new Date();
dd.setHours(ti);
dd.setMinutes(h);
var x = new UTC(dd.getTime());
if (numofDays)
{
x = new UTC(dd.addDays(numofDays));
}
return x;
} Hope this helps.... |
Please Log in to join the conversation. |
|
Thanks for your quick reply . But my actual question was
If I have to load an event that is for a particular date and which is not current date, How do I do it? For Example: Today is April 24th 2010. When I load an event as done in the sample files, it always shows up on today's date. Suppose I want to load an event that is on say April 30th 2010. How do I do it? |
Please Log in to join the conversation. |
|
You basically néed to provide date and time.
Try new Date(2010, 3,30,2,30). This represents April 30,2010 2:30 AM see www.w3schools.com/jsref/jsref_obj_date.asp for more info |
Please Log in to join the conversation. Team Web2Cal. |