JQuery week calendar reoccurring events

JQuery has a nice plugin called . Very simple to use and I was able to integrate it into the database to handle pulling scheduling data. However I came across one issue. Reoccurring events.

Well after scrambling the web, I came to the conclusion that it wasn’t possible in the code by default. So away into the code I went. To say the least, my solution is nowhere near perfect nor does it allow for reoccurring events yet from different weeks or months. It was decided to take another course of action rather than trying to hack reoccurring events into the code. I just wanted to post what I had so far:

In jquery.weekcalendar.js we have this code:

              //put back the initial start date

Now before this and the block of code before it, I added in:

			if ($.isArray(recurring))
			{
				var cur_date = new Date();
				var cur_dayofweek = cur_date.getDay();
				var org_start_date = calEvent.start.getDate();
				var org_end_date = calEvent.end.getDate();

				for(var i= 0; i

This lets me do reoccurring events for the current week. I am sure it could be greatly improved and somebody may be able to make it support multiple weeks.

In case anybody else wondered, this simply just needs a json array in the data of the weekday numbers (0-6). The key is recurring.

				{
					"id":15,
					"start": "Sun, 4 Dec 2011 21:00:00 -0500",
					"end": "Sun, 4 Dec 2011 22:30:00 -0500",
					"title":"Reoccurring",
					"recurring": [1,2,5,6]
				}

6 Comments

    • Hey Tim,

      Sorry for the delay. This was merged into to main repository. So you can download the latest version off their GitHub repository to get this fix included.

    • This was merged into their code base, so it shouldn’t be a problem now.

      But you still need to specify that its a recurring event

  1. I have the latest version of jquery.weekcalendar.js and i can’t find anything that referent to “recurring”. Any idea?

    • I know they merged the commit so it should be there. I haven’t used this in a while as I haven’t needed it for any other projects I have done.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.