Solved

asp calendar - customize display

Posted on 2013-12-11
4
426 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

808 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