【问题标题】:How to set up the current day (today) as a default date on FullCalendar? [duplicate]如何将当天(今天)设置为 FullCalendar 上的默认日期? [复制]
【发布时间】:2017-12-21 12:08:45
【问题描述】:

现在默认日期是 2017-12-12...

$(document).ready(function() {

    $('#calendar').fullCalendar({
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay,listWeek'
      },


      defaultDate: '2017-12-12',
      navLinks: true, // can click day/week names to navigate views
      businessHours: true, // display business hours
      editable: true,
      eventLimit: true, // allow "more" link when too many events

【问题讨论】:

    标签: jquery


    【解决方案1】:
    $('#calendar').fullCalendar({
        defaultDate: new Date()
    });
    

    $('#calendar').fullCalendar({
        defaultDate: moment('2014-09-01'),
        ...
    });
    

    【讨论】:

      【解决方案2】:

      您可以在此脚本中直接将今天设置为默认值

      $("#calendar").datepicker().datepicker("setDate", new Date());
      

      【讨论】:

      • 这不是日期选择器,它是全日历。
      猜你喜欢
      • 2017-11-26
      • 1970-01-01
      • 1970-01-01
      • 2014-01-12
      • 1970-01-01
      • 2021-09-06
      • 2011-06-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多