ui日历:如果时间小于上午9点,则事件不包括结束日期

ui-calender : event not including end date if time is less than 9 am

本文关键字:事件 不包括 日期 结束 9点 日历 如果 时间 小于 ui      更新时间:2023-09-26

我使用的是angular ui日历插件,它使用fullcalendar在日历上显示事件。我遇到了一个奇怪的结果。如果事件在上午9点之前结束,则呈现的事件不包括结束日期。

这是我的两个活动:

 $scope.staticEvents = [
    {
      title: 'Static 1', 
    end: new Date(2015, 10, 30, 8, 30, 0, 0),
    start: new Date(2015, 10, 26, 8, 0, 0, 0)
    },
     {
       title: 'Static 2', 
      end: new Date(2015, 10, 30, 9, 0, 0, 0),
      start: new Date(2015, 10, 26, 8, 0, 0, 0)
      }
  ];

请在这里找到代码:plunker

如何在此场景中包括事件的结束日期?代码中缺少什么吗?

谢谢。

这是因为在fullCalendar中,nextDayThreshold默认设置为上午9点。您需要将其重置为上午12点。

更多信息点击这里

你在控制器中这样设置这个选项:

$scope.uiConfig = {
  calendar:{
  nextDayThreshold:'00:00:00'
  }
};