[英]jquery full calendar move the calendar forward one week and block the next button.
[英]full calendar pass week firstdate to controller - moving next week jquery
我有完整的日歷。 我想將星期的開始日期傳遞給控制器,以便移至上一個/下一個星期。 我包括我的jQuery,如下所示:
var calendar = $('#calendar').fullCalendar(
{
header: {
left: 'prev',
center: 'title',
right: 'next'
},
defaultView: 'basicWeek',
events: function (start, end, callback) {
$.get('events/get', function (result) {
callback(result);
});
var cDate = new Date(); var Cyear = cDate.getFullYear(); year = Cyear;
var Sun = $('#calendar').find(".fc-sun").text(); d1 = Sun; SelectDate = Sun + "/" + year;
}
});
$('#btnPrev').click(function () {
$('#calendar').fullCalendar('prev');
$.ajax({
type: "POST",
url: '/Timesheet/Index',
data: SelectDate
});
});
$('#btnNext').click(function () {
$('#calendar').fullCalendar('next');
//$.ajax({
// type: "POST",
// url: "/Timesheet/Index?SelectDate=" + SelectDate,
// success: function (data) {
// },
// error: function () {
// }
//});
});
如何將其傳遞給控制器?
我可以使用以下代碼在日歷中移動下一個/上個星期:
$('.fc-prev-button').click(function () {
startDate = $('#calendar').fullCalendar('getDate').startOf('week');
window.location.href = "/TimesheetModels/EmpTimesheet?selectDate=" + convertDate(startDate);
});
$('.fc-next-button').click(function () {;
startDate = $('#calendar').fullCalendar('getDate').startOf('week');
window.location.href = "/TimesheetModels/EmpTimesheet?selectDate=" + convertDate(startDate);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.