3
메신저가 fullcalendar 플러그인에 문제가있는 경우 인스턴트 메신저로 클릭 한 번으로 전체보기를 선택한 다음이 일정을 만드는 중입니다. 즉, 특정 요일에 어떤 요일을 클릭하면 해당 요일이 강조 표시되고 이벤트가 생성됩니다. 이 이벤트는 내 데이터베이스에 입력해야합니다.전체 주간 전체 선택
<script>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
// page is now ready, initialize the calendar...
$("#calendar").fullCalendar({
// put your options and callbacks here
header: {
right: "today prev,next",
left: "title",
},
height:650,
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var title = confirm("Apply for kitchenweek?");
if (title) {
calendar.fullCalendar("renderEvent",
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
calendar.fullCalendar("unselect");
},
editable: true,
events: "/json-events.php"
})
});
</script>
어떤 도움이 많이 이해할 수있을 것이다 :
이것은 내가 지금까지있는 것입니다.
<script>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
// page is now ready, initialize the calendar...
var calendar = $("#calendar").fullCalendar({
// put your options and callbacks here
header: {
right: "today prev,next",
left: "title"
},
height:650,
events: "/json-events.php",
//selectable: true,
selectHelper: true,
dayClick: function(start, allDay, jsEvent, view) {
$(this).parent().siblings().removeClass("week-highlight");
$(this).parent().addClass("week-highlight");
if(start < date && start.getDate() != date.getDate())
{
alert("Cannot select past dates.");
$(this).parent().removeClass("week-highlight");
return;
}
var title = confirm("Apply for kitchenweek?");
var now = date? new Date(start-1) : new Date();
now.setHours(0,0,0,0);
var monday = new Date(now);
monday.setDate(monday.getDate() - monday.getDay() + 1);
var sunday = new Date(now);
sunday.setDate(sunday.getDate() - sunday.getDay() + 7);
if (title) {
calendar.fullCalendar("renderEvent",
{
title: "Kitchenweek for: '; echo $username; echo'",
start: monday,
end: sunday,
allDay: allDay
},
true // make the event "stick"
);
var mondaydate = $.fullCalendar.formatDate(monday,"yyyy-MM-dd");
var sundaydate = $.fullCalendar.formatDate(sunday,"yyyy-MM-dd");
var pname = "Kitchenweek for: '; echo $username; echo'";
var username = "'; echo $username; echo'";
$.ajax({
type: "POST",
url: "/new_event.php",
data: {
startdate: mondaydate,
enddate: sundaydate,
event_title: pname,
uname: username
}
});
}
$(this).parent().removeClass("week-highlight");
}
});
});
</script>
편집하는 대신 질문에 대답을 추가해야합니다. – karancan
답변을 해결책으로 게시하십시오. – ChrisF