Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullcalendar- how to strike off and display completed tasks

With the Fullcalendar plugin, is there any way to strike off completed tasks (atleast using <strike> tag). I am taking the tasks out of my database and the results is passed to json_encode().

like image 442
misty Avatar asked Nov 26 '22 10:11

misty


1 Answers

If you're on v5 add this to the constructor:

eventClassNames: function(arg) 
{
    //standard event properties are under the "event" object
    //and any other property/value you've added to the event 
    //object will be available under "event.extendedProps",
    //just like this 'isUrgent' in the sample bellow:

    if (arg.event.extendedProps.isUrgent) 
    {
        return [ 'urgent' ]
    }
    else
    {
        return [ 'normal' ]
    }
}

    <style type="text/css">
    .normal
    {
        text-decoration: none;
    }
    .urgent
    {
        text-decoration: line-through;
    }
    </style>
like image 111
paul-2011 Avatar answered May 13 '23 11:05

paul-2011