Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

Linking jQueryUI DatePicker and FullCalendar

In one of my sample projects I wrote simple calendar solution. Users can select dates from calendar and see what events they have on selected days. I used jQueryUI DatePicker and FullCalendar components. In this posting I will show you how to link them together.

Update: source code of this project is available at CodePlex. Please visit MVC Time Planner page for further information and downloads.

To get better idea what I was doing take a look at the following screenshot. jQueryUI DatePicker is the small calendar on left. FullCalendar is larger one that is opened in day view. When user selects date from DatePicker then FullCalendar loads events for given date.

jQuery UI DatePicker and FullCalendar

The trick here is very simple. Here is how I initialize DatePicker.


$(document).ready(function() {     $('#datepicker').datepicker({         inline: true,         onSelect: function(dateText, inst) {             var d = new Date(dateText);             $('#calendar').fullCalendar('gotoDate', d);         }     }); }

The ID of FullCalendar is calendar. If user picks something from DatePicker then DatePicker calls gotoDate method of FullCalendar. FullCalendar selects given date and makes request to server to get events for given date.

kick it on DotNetKicks.com Shout it! 顶 Progg it Shout it

Comments

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# February 2, 2010 5:52 AM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# February 2, 2010 5:53 AM

progg.ru said:

Thank you for submitting this cool story - Trackback from progg.ru

# February 2, 2010 5:55 AM

9eFish said:

9efish.感谢你的文章 - Trackback from 9eFish

# February 2, 2010 5:56 AM

Servefault.com said:

Thank you for submitting this cool story - Trackback from Servefault.com

# February 2, 2010 5:57 AM

Gunnar Peipman's ASP.NET blog said:

I found very good jQuery component called FullCalendar. My special favorites are agenda views because

# February 3, 2010 12:27 PM

Twitter Trackbacks for Linking jQueryUI DatePicker and FullCalendar - Gunnar Peipman's ASP.NET blog [asp.net] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Linking jQueryUI DatePicker and FullCalendar - Gunnar Peipman's ASP.NET blog         [asp.net]        on Topsy.com

# February 7, 2010 6:21 AM

Craig M. Rosenblum said:

What about when the fullcalendar changes month/year to have the datepicker change as well..

Did you get that working?

# May 13, 2010 11:43 AM

Todd said:

Nice. Thank you.

# October 11, 2010 4:38 PM

jquery – How can I select the whole week in month view by changing its background color – http://arshaw.com/fullcalendar/ said:

Pingback from  jquery – How can I select the whole week in month view by changing its background color – arshaw.com/fullcalendar

# September 3, 2012 4:19 AM

svensken said:

good job thank u :)

# February 15, 2013 11:26 AM

Using FullCalendar jQuery component with ASP.NET MVC | Gunnar Peipman - Programming Blog said:

Pingback from  Using FullCalendar jQuery component with ASP.NET MVC   | Gunnar Peipman -  Programming Blog

# May 23, 2013 3:53 PM