get the date in the fullcalendar select event

3

I would like to know how to get the value of data when doing the select of a day in fullcalendar

 select: function(start, end, allDay) {
        start = $.fullCalendar.formatDate(start, 'yyyy-MM-dd');
        alert('Valor da data: ' + start);
 }

I have done so but it does not work

    
asked by anonymous 11.04.2015 / 20:57

1 answer

3

By reading the documentation they suggest using the .formatRange () , and you can use the same day at the beginning and end of this range. Also note that I use capitals in date format: 'YYYY-MM-DD' .

So:

select: function (start, end, allDay) {
    start = $.fullCalendar.formatRange(start, start, 'YYYY-MM-DD');
    alert('Valor da data: ' + start);
}

jsFiddle: link

    
11.04.2015 / 21:09