FC day colors

by slicedtoad

HTML

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.css">
<button data-color='green'>green</button>
<button data-color='yellow'>yellow</button>
<div id='calendar'></div>

JavaScript

$("#calendar").fullCalendar({
    dayRender:function(date, cell){
        cell.css("background-color","red");
    },
    dayClick:function(){
        console.log(this);
        $(this).css("background-color","white");
    },
});
$("body > button").on("click",function(){
    $(".fc-bg .fc-day").filter(function(index,day){
        if($(day).data("date")==="2015-08-02")
            return true;
        else
            return false;
    }).css("background-color",$(this).data("color"));
})