01.
var
calendar = $(
'#calendar'
).fullCalendar({
02.
customButtons: {
03.
mylistButton: {
04.
text:
'รายการทำงานของฉัน'
,
05.
click:
function
() {
06.
swal({
07.
title:
"เร็วๆนี้ !"
,
08.
icon:
"error"
,
09.
button:
"ออก"
,
10.
});
11.
}
12.
}
13.
},
14.
header: {
15.
left:
'prev,next today mylistButton'
,
16.
center:
'title'
,
17.
right:
'month,agendaWeek,agendaDay'
18.
},
19.
events:
'../php-plugins/dairy_timestamp_calender.php'
,
20.
selectable:
true
,
21.
selectHelper:
true
,
22.
timeFormat:
'H(:mm)'
,
23.
eventRender:
function
(eventObj, $el) {
24.
$el.popover({
25.
title: eventObj.title,
26.
content: eventObj.description,
27.
trigger:
'hover'
,
28.
placement:
'top'
,
29.
container:
'body'
30.
});
31.
},
32.
eventClick:
function
(event)
33.
{
34.
var
id = event.id;
35.
$(
'#dairy_list_stamp_id'
).val(id);
36.
if
($(
this
) !==
new
Date())
37.
{
38.
swal(
"กรุณาเลือกรายการวันนี้เท่านั้น !"
);
39.
}
40.
else
41.
{
42.
$.ajax({
43.
url:
"../php-plugins/dairy_timestamp_fatch.php"
,
44.
method:
"POST"
,
45.
data:{id:id},
46.
dataType:
"json"
,
47.
success:
function
(data)
48.
{
49.
$(
'#dairy_list_stamp_list'
).val(data.dairy_list_name);
50.
}
51.
})
52.
}
53.
},
54.
});