$((function(){var e=$("#scheduler").dxScheduler({dataSource:data,views:[{type:"day",name:"day"},{type:"week",name:"week"},{type:"month",name:"month"},{type:"timelineDay",name:"timelineDay"},{type:"agenda",name:"agenda"}],currentView:"day",currentDate:new Date,firstDayOfWeek:0,startDayHour:9,endDayHour:20,showAllDayPanel:!0,height:600,groups:["theatreId"],crossScrollingEnabled:!0,cellDuration:15,editing:{allowAdding:!0,allowDeleting:!0,allowUpdating:!0,allowResizing:!0,allowDragging:!0},resources:[{fieldExpr:"movieId",dataSource:customerData,useColorAsDefault:!0},{fieldExpr:"theatreId",dataSource:theatreData}],appointmentTooltipTemplate:function(e,n){return a(e,t(e.movieId))},appointmentTemplate:function(e){var a=t(e.movieId)||{};return $("<div class='showtime-preview'><div>"+a.text+"</div><div>Ticket Price: <strong>$"+e.price+"</strong></div><div>"+Globalize.formatDate(e.startDate,{time:"short"})+" - "+Globalize.formatDate(e.endDate,{time:"short"})+"</div></div>")},onAppointmentFormOpening:function(e){},onAppointmentDeleted:function(t){e.hideAppointmentTooltip()}}).dxScheduler("instance");function t(e){return DevExpress.data.query(customerData).filter("id",e).toArray()[0]}function a(t,a){var n=a.color?"style='background-color:"+a.color+"'":"",i=$("<div class='appointment-content'><div class='appointment-badge'"+n+">"+a.text[0]+"</div><div class='appointment-text'>"+a.text+"</div><div class='appointment-dates'>"+Globalize.formatDate(t.startDate,{skeleton:"MMMd"})+" , "+Globalize.formatDate(t.startDate,{time:"short"})+" - "+Globalize.formatDate(t.endDate,{time:"short"})+"</div></div>"),o=$("<div title='delete this'>").addClass("delete-appointment").dxButton({icon:"trash",onClick:function(){e.deleteAppointment(t)}});return i.append(o),i}}));