我正在努力使全日历从今天开始。 它是什么显示了整整一个星期当我这样做: -今天的全日历开始日期
$('#calendar').fullCalendar({
// Options
});
$('#calendar').fullCalendar('gotoDate', currentDate);
其中的currentdate今天。
Refernce: - http://flickfootball.in/ 点击日历选项卡上..
我正在努力使全日历从今天开始。 它是什么显示了整整一个星期当我这样做: -今天的全日历开始日期
$('#calendar').fullCalendar({
// Options
});
$('#calendar').fullCalendar('gotoDate', currentDate);
其中的currentdate今天。
Refernce: - http://flickfootball.in/ 点击日历选项卡上..
你想这样 试试这个
$(function() {
\t $('#calendar').fullCalendar({
\t \t header: {
\t \t \t left: 'prev,next today',
\t \t \t center: 'title',
\t \t \t right: 'month,agendaWeek,agendaDay'
\t \t },
\t \t defaultDate: '2016-01-12',
\t \t editable: true,
\t \t eventLimit: true, // allow "more" link when too many events
\t \t
\t });
});
<link rel='stylesheet' href='http://fullcalendar.io/js/fullcalendar-2.6.1/fullcalendar.min.css' />
<script src='//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js'></script>
<script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.6.1/fullcalendar.min.js'></script>
<link rel='stylesheet' href='http://fullcalendar.io/js/fullcalendar-2.6.1/fullcalendar.min.css' />
<div id='calendar'></div>
添加以下代码
$('#my-today-button').click(function() {
$('#calendar').fullCalendar('today');
});
有关更多信息,请link
请参考以下链接
How to show description of Events in fullcalendar
//我使用moment.js用于拍摄日期为今天 - today_date =时刻()格式(“YYYY -MM-DD');
//在这一行中,我给予默认日期为今天。 - defaultDate:today_date,
不起作用。 所有这些解决方案只是使今天成为可能。 它不会使日历从今天开始。 –
发现黑客。 虽然不是一个合适的解决方案。
全日历允许你用firstDay:''开始你的日历。 因此,只需找出今天是哪一天,并将其设置为第一天。 所以日历从那天开始。
var d = new Date(); var t = d.getDay();
firstDay:T,
看看@claudia回答:)。你可能想要更新你的答案 –
FullCalendar取决于moment.js,所以你可以做:
var today = moment().day();
$('#calendar').fullCalendar({
firstDay: today
});
设置defaultDate
像这样:
例
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listYear'
},
defaultDate: $('#calendar').fullCalendar('today'), // THIS IS WHAT YOU'RE LOOKING FOR
nowIndicator: true,
navLinks: true, // click day/week names to navigate to date
editable: true, // allows drag/drop
eventLimit: true, // allow "more" link when too many events
events: [] //an array of your events here
});
更多获取当前日here
这就足以调整它: firstDay:today –
NO的文件中。 这就是我不想要的。 它显示当天日期下降的周。 我希望它从今天开始。 –