text: var Calendar=function(){"use strict";var e,t,a=new Object;a.start=moment(),a.end=moment().add(1,"days");var l=function(){var e=$("#start-date-time"),t=$("#end-date-time");e.datetimepicker(),t.datetimepicker(),e.on("dp.change",function(e){t.data("DateTimePicker").minDate(e.date)}),t.on("dp.change",function(t){e.data("DateTimePicker").maxDate(t.date)})};return{init:function(){var a;!function(){var t=new Date;t;var a=t.getDate(),l=t.getMonth(),n=t.getFullYear();e=[{title:"Networking",start:new Date(n,l,a,20,0),end:new Date(n,l,a,21,0),className:"event-job",category:"job",allDay:!1,content:"Out to design conference"},{title:"Bootstrap Seminar",start:new Date(n,l,a-5),end:new Date(n,l,a-2),className:"event-off-site-work",category:"off-site-work",allDay:!0},{title:"Lunch with Nicole",start:new Date(n,l,a-3,12,0),end:new Date(n,l,a-3,12,30),className:"event-generic",category:"generic",allDay:!1},{title:"Corporate Website Redesign",start:new Date(n,l,a+5),end:new Date(n,l,a+10),className:"event-to-do",category:"to-do",allDay:!0}]}(),function(){$(".add-event").off().on("click",function(){l(),$(".form-full-event #event-id").val(""),$(".events-modal").modal()}),$(".events-modal").on("hide.bs.modal",function(e){$(".form-full-event #event-id").val(""),$(".form-full-event #event-name").val(""),$(".form-full-event #start-date-time").val("").data("DateTimePicker").destroy(),$(".form-full-event #end-date-time").val("").data("DateTimePicker").destroy(),$(".event-categories[value='job']").prop("checked",!0)}),$("#event-categories div.event-category").each(function(){var e={title:$.trim($(this).text())};$(this).data("eventObject",e),$(this).draggable({zIndex:999,revert:!0,revertDuration:50})});var a=new Date;a.getDate(),a.getMonth(),a.getFullYear();$("#full-calendar").fullCalendar({buttonIcons:{prev:"fa fa-chevron-left",next:"fa fa-chevron-right"},header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},events:e,editable:!0,eventLimit:!0,droppable:!0,drop:function(t,a){var l=$(this).data("eventObject"),n=$(this).attr("data-class");t=moment(new Date(t)).format("YYYY-MM-DD hh:mm"),moment(new Date(t)).add(1,"hours").format("YYYY-MM-DD hh:mm"),$("#full-calendar").fullCalendar("renderEvent",{title:l.title,start:t,allDay:!0,category:n,className:"event-"+n},!0),e=$("#full-calendar").fullCalendar("clientEvents"),$("#drop-remove").is(":checked")&&$(this).remove()},selectable:!0,selectHelper:!0,select:function(e,t,a){l(),$(".form-full-event #event-id").val(""),$(".form-full-event #event-name").val(""),$(".form-full-event #start-date-time").data("DateTimePicker").date(moment(e)),$(".form-full-event #end-date-time").data("DateTimePicker").date(moment(e).add(1,"hours")),$(".event-categories[value='job']").prop("checked",!0),$(".events-modal").modal()},eventClick:function(a,n,r){l();for(var o=a._id,d=0;d<e.length;d++)e[d]._id==o&&($(".form-full-event #event-id").val(o),$(".form-full-event #event-name").val(e[d].title),$(".form-full-event #start-date-time").data("DateTimePicker").date(moment(e[d].start)),$(".form-full-event #end-date-time").data("DateTimePicker").date(moment(e[d].end)),t=""==e[d].category||void 0===e[d].category?"Generic":e[d].category,$(".event-categories[value='"+t+"']").prop("checked",!0));$(".events-modal").modal()}}),e=$("#full-calendar").fullCalendar("clientEvents")}(),$(".form-full-event").validate({errorElement:"span",errorClass:"help-block",ignore:"",rules:{eventName:{minlength:2,required:!0},eventStartDate:{required:!0,date:!0},eventEndDate:{required:!0,date:!0}},messages:{eventName:"* Please specify the event title"},highlight:function(e){$(e).closest(".help-block").removeClass("valid"),$(e).closest(".form-group").removeClass("has-success").addClass("has-error").find(".symbol").removeClass("ok").addClass("required")},unhighlight:function(e){$(e).closest(".form-group").removeClass("has-error")},success:function(e,t){e.addClass("help-block valid"),$(t).closest(".form-group").removeClass("has-error").addClass("has-success").find(".symbol").removeClass("required").addClass("ok")},submitHandler:function(t){var l=new Object;if(l.title=$(".form-full-event #event-name ").val(),l.start=new Date($(".form-full-event #start-date-time").val()),l.end=new Date($(".form-full-event #end-date-time").val()),l.category=$(".form-full-event .event-categories:checked").val(),l.className="event-"+$(".form-full-event .event-categories:checked").val(),""!==$(".form-full-event #event-id").val()){a=$(".form-full-event #event-id").val();var n=$("#full-calendar").fullCalendar("clientEvents",a);n=n[0];for(var r=0;r<e.length;r++)e[r]._id==a&&(l._id=a);$("#full-calendar").fullCalendar("removeEvents",n._id),$("#full-calendar").fullCalendar("renderEvent",l,!0),e=$("#full-calendar").fullCalendar("clientEvents")}else $("#full-calendar").fullCalendar("renderEvent",l,!0),e=$("#full-calendar").fullCalendar("clientEvents");$(".events-modal").modal("hide")}})}}}();