Reputation: 51
How can I use the gotoDate method on button click event. I am trying to reset the calendar selected month. I am entering a date in a text box, And when I click on a button the script read the date from text box, and now I want to reset the calendar month as I have entered in the text box. How can I do this?
Upvotes: 1
Views: 2336
Reputation: 7266
Never used FullCalendar but try this:
$("#Button1").click(function () {
var txt = $("#Text1").val();
var dt = new Date(Date.parse(txt));
var d = dt.getDate();
var m = dt.getMonth();
var y = dt.getFullYear();
$('#calendar').fullCalendar('gotoDate', y, m,d);
});
Upvotes: 2