事件的Fullcalendar SetDate与AllDay不匹配';行不通

事件的Fullcalendar SetDate与AllDay不匹配';行不通,fullcalendar,fullcalendar-4,Fullcalendar,Fullcalendar 4,可以使用以下函数的状态: event.setDates( start, end, [ options ] ) 其中,[options]接受一个属性为allDay的纯对象,其属性为true或false,但我似乎无法实现这一点,因为我尝试了多种方法。虽然由setDate()设置该属性的事件不会输出任何错误,但它们也不会出现在日历中 我所尝试的: 将对象存储在变量中并使用该变量: year=calendar.getDate().getFullYear(); var all_day_对象={ 全天:没

可以使用以下函数的状态:

event.setDates( start, end, [ options ] )
其中,[options]接受一个属性为allDay的纯对象,其属性为true或false,但我似乎无法实现这一点,因为我尝试了多种方法。虽然由setDate()设置该属性的事件不会输出任何错误,但它们也不会出现在日历中

我所尝试的:

  • 将对象存储在变量中并使用该变量:
  • year=calendar.getDate().getFullYear();
    var all_day_对象={
    全天:没错,
    };
    calendar.getEventById('new_year').setDates(`${year}-01-01`、`${year}-01-01`、all_day_object);
    
  • 将其设定为真实并希望达到最好:
  • year=calendar.getDate().getFullYear();
    calendar.getEventById('new_year').setDates(`${year}-01-01`,`${year}-01-01`,true);
    
  • 在同一行中创建带括号的对象:
  • year=calendar.getDate().getFullYear();
    calendar.getEventById('new_year').setDates(`${year}-01-01`、`${year}-01-01`、{allDay:true});
    
    虽然我可以使用此代码实现相同的效果:

    year=calendar.getDate().getFullYear();
    calendar.getEventById('new_year').setDates(`${year}-01-01`,`${year}-01-01`);
    calendar.getEventById(“新年”).setAllDay(true);
    

    我想用一行代码来简化我的代码。

    当设置allDay:true时,这个错误似乎特别明显。如果使用该选项将allDay:false设置为false,则效果良好。另外,您已经标记了v4,现在不太可能看到任何修复,但是这个bug似乎仍然存在于新的v5-demo中:。我建议报告一个bug:当设置allDay:true时,这个bug似乎特别明显。如果使用该选项将allDay:false设置为false,则效果良好。另外,您已经标记了v4,现在不太可能看到任何修复,但是这个bug似乎仍然存在于新的v5-demo中:。我建议报告一个bug: