tags:

views:

41

answers:

2

If you read the title you read my question correctly. I am wondering how I make my events mimic dayClick so any event selected on that day will select dayClick instead of linking with a url. just for insight on what I am doing my calendar currently looks like this

http://img.photobucket.com/albums/v451/Plop4152/Screenshot2010-07-27at43348PM.png

A: 

Can you use eventClick: and just use a shared function between dayclick and eventclick?

        $('#calendar').fullCalendar({
            header: {
                left: 'prev, next today',
                center: 'title',
                right: 'month, basicWeek, basicDay'
            },
            eventClick: function(calEvent, jsEvent, view) {
                alert('Event: ' + calEvent.title);
                alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
                alert('View: ' + view.name);
                // change the border color just for fun
                $(this).css('border-color', 'red');
            }
        });
Jake1164
A: 

I would define a separate function you want to call when dayClick is called, and then modify eventClick so that it calls that function.

function myDayClick(date)
{
    alert('You clicked ' + date);
}

$('#calendar').fullCalendar({
    dayClick: function(date, allDay, jsEvent, view) {
        myDayClick(date);
    },
    eventClick: function(calEvent, jsEvent, view) {
        myDayClick(calEvent.start);
    }
});
theycallmemorty