Skip to content

Instantly share code, notes, and snippets.

@tim-bellette
Last active December 7, 2017 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tim-bellette/a0cca21413efa8336797165bc1c88070 to your computer and use it in GitHub Desktop.
Save tim-bellette/a0cca21413efa8336797165bc1c88070 to your computer and use it in GitHub Desktop.
Simple script to automatically refresh a SharePoint 2010 calendar's items every 10 seconds
<script type="text/javascript">
setInterval(function() {
try {
var calendar = SP.UI.ApplicationPages.CalendarInstanceRepository.firstInstance(); // Get the first calendar instance on the page
if (calendar) {
calendar.refreshItems(); // async refresh of calendar items
}
}
catch (e) {
// ignore
}
}, 10000); // Every 10 seconds
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment