Imran
Imran

Reputation: 51

JQuery Full Calendar: How can i get the month/day/week view by providing a specific date from date time text box

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

Answers (1)

gbs
gbs

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

Related Questions