JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/jquery.weekcalendar.js"></script>
<link rel="stylesheet" href="http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/jquery.weekcalendar.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css">
<a href="#" id="reveal_popup" data-reveal-id="reveal_popup" data-closeonbackgroundclick="false" data-dismissmodalclass="close-reveal-modal">due_today</a>
<div id="reveal_popup" class="reveal-modal">
<div id="calendar_popup"></div>
<a class="close-reveal-modal">×</a>
</div>
JavaScript
jQuery(document).ready(function($)
{
$('#reveal_popup').click(function()
{
calendarpop('MT','1');
});
var calendarpop = function calendarpop(cat,typ)
{
var days;
if(typ == 1){
days = 1;
}
else if(typ==2){
days = 2;
}
else if(typ==3){
days = 7;
}
var $calendar = $('#calendar_popup').weekCalendar({
timeslotsPerHour: 4,
scrollToHourMillis : 0,
height: function($calendar){
return $(window).height() - $('h1').outerHeight(true);
},
eventRender : function(calEvent, $event) {
if (calEvent.end.getTime() < new Date().getTime()) {
$event.css('backgroundColor', '#aaa');
$event.find('.wc-time').css({
backgroundColor: '#999',
border:'1px solid #888'
});
}
},
data : function(start, end, callback) {
$.getJSON(
site_url()+'/event/eventpop/'+cat+'/'+typ,
'',
function(result) {
callback(result);
}
);
},
allowCalEventOverlap : true,
overlapEventsSeparate: true,
showAsSeparateUser: false,
displayOddEven: true,
displayFreeBusys: true,
daysToShow: days,
buttons: false,
headerSeparator: ' ',
useShortDayNames: true,
firstDayOfWeek: $.datepicker.firstDay,
shortDays: $.datepicker.dayNamesShort,
longDays: $.datepicker.dayNames,
shortMonths: $.datepicker.monthNamesShort,
longMonths: $.datepicker.monthNames,
businessHours :{
start: 6,
end: 22,
limitDisplay: true
},
dateFormat: 'd F Y'
});
}
});