Solved

asp calendar - customize display

Posted on 2013-12-11
4
414 Views
Last Modified: 2013-12-11
Hi
My organization is using a classic asp calendar to display events. Each day displays the name of the event and the starting time. Sometimes there are repeating events on the same day with different starting times. This causes a redundant display of event names for the same day. I would like to leave only the first instance of a repeating event name and just show the different starting times.
I can't figure out how to do this. Is there some way of manipulating the recordset or the display, in Jquery maybe, to remove certain entries?
Here is the calendar:
http://www.imj.org.il/vision/calendar/
Thanks,
Avi
0
Comment
Question by:avir
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39711042
Do you want to do that with jQuery after loading the page?
0
 

Author Comment

by:avir
ID: 39711048
That could be good.
I thought of surrounding each event name with a div and assigning its name as a class and then removing all of them except the first. But I'm not sure of how to do this.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39711054
The following do the thing :
$(document).ready(function() {
	var calendar = $(".nine.large-9.columns.col-content");
	var days = $("td", calendar); 
	days.each(function() {
		var dis = $(this);
		$("div.item a", dis).map(function() {
			var value = $(this).text();
			var with_same_value = $("div.item a", dis).filter(function() { return $(this).text()==value; });
			var duplicates = with_same_value.not(":first");
			var calendar_events = duplicates.closest("div");
			calendar_events.remove();
		});
	});	
});

Open in new window

work
0
 

Author Closing Comment

by:avir
ID: 39711076
Very good, except it also removed the hours. But I fixed it by taking the hours out of the div.
Thank you very much.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now