robmonie / jquery-week-calendar

Now actively maintained in the following fork - https://github.com/themouette/jquery-week-calendar
388 stars 388 forks source link

event repeated #21

Open bbenjii123 opened 14 years ago

bbenjii123 commented 14 years ago

Hello

I would like to know how to create few events in the week ? I would like to create a periodicity for an event and when the user fill this information, the event is repeated in the week. I have took the jquery-week-calendar from themouette and in the /full_demo/demo.js, I add this after the line 59 :

id++;
calEvent.id = id;
calEvent.start = new Date(startField.val());
calEvent.start = calEvent.start.setTime(calEvent.start.getTime() +  86400000);
calEvent.end = new Date(endField.val());
calEvent.end = calEvent.end.setTime(calEvent.end.getTime() +  86400000);
calEvent.title = titleField.val();
calEvent.body = bodyField.val();

$calendar.weekCalendar("updateEvent", calEvent);

and when I create an event on 5th July, it brings forward to 6th July

Zambros commented 14 years ago

Hi, I suppose you use a database. So you can duplicate event when you save the event by server side. Use the week-calendar only to save data and show data. Put the business logic in the server side.

I do this for my application