This topic came up over on SharePoint.StackExchange.com, and I thought I’d share here too.
You may want to setup a single page to view multiple calendars. Calendar overlay is a great way to handle this, but what if you want to see these side by side, and let the user navigate the dates in unison, so clicking Next Day will go to the next day, on each calendar.
Looking at the above, clicking the day navigation will only update that one calendar web part. Not cool. How do we fix that?
Insert a Snippet App Part, and copy and paste this code into it. It’s a little raw, but it works. Class it up for your brand and site as you need.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <div> <a href='#' id='newPrevDay'>Previous Day</a> &nbsp; <a href='#' id='newNextDay'>Next Day</a> </div> <script type="text/javascript"> $(document).ready(function(){ ExecuteOrDelayUntilScriptLoaded(overrideButtons,"SP.UI.ApplicationPages.Calendar.js"); function overrideButtons() { $("#newPrevDay").click(function() { $("a[title=\"Previous Day\"]").each(function() { eval($(this).attr("href")); }); }); $("#newNextDay").click(function() { $("a[title=\"Next Day\"]").each(function() { eval($(this).attr("href")); }); }); } }); </script>
Once the code is in, the calendar’s buttons will be hidden and the new buttons will appear, like so:
Hello David, I have a question about lists and calendars: it is possible to make a list from multiple calendars?
Hi Ana,
It depends on what you hope to do with the list. You can use a search web part and configure it to point to the lists you want, and it’ll return a list. If you want it interactive (add new, edit, delete) then that’ll get a lot more custom. Let me know where you want to go with it.
Thanks,
David
I want something interactive, like you mentioned. For example, if I add something in a calendar that information I want it also in the list. It is possible? Can you please give me an idea?
Thanks a lot!
So you could use the search web part to list the items from a calendar, and after search indexes the newly added data it would appear there. Also, you could look at using a workflow to copy the data form the calendar to a list. Email me david.lozzi at slalom.com what you’re trying to do, what the purpose of the list is and we can figure something out.
I can seem to get this working on sharepoint 2013, is there something i need to change?
Hi Thomas, are you getting any errors? Have you checked the dev toolbar for errors? See https://davidlozzi.com/2013/05/15/a-non-developers-intro-to-the-developer-toolbar-scripting/ for more details how
works like a charm on SP2010!!! great article! thank you!!
Thanks for sharing it works on SP2010!
I cant seem to get this to work on sharepoint 2013, is there something i need to change?