将 FullCalendar 与 Angular 8 一起使用,与 timeGridWeek 不同,dayGridMonth 中的事件没有结束值

Using FullCalendar with Angular 8, the events in dayGridMonth do not have an end value unlike timeGridWeek

我想在 dayGridMonth 视图上显示事件的结束时间,但是当访问 eventTimeFormat 对象时,与 timeGridWeek 视图不同,键 'end' 没有值。

如何让 FullCalendar 使用 dayGridMonth 视图中的值填充结束键?

对于 dayGridMonthView

{
  "date": {
    "marker": "2019-09-20T10:30:00.000Z",
    "timeZoneOffset": 480,
    "array": [
      2019,
      8,
      20,
      10,
      30,
      0,
      0
    ],
    "year": 2019,
    "month": 8,
    "day": 20,
    "hour": 10,
    "minute": 30,
    "second": 0,
    "millisecond": 0
  },
  "start": {
    "marker": "2019-09-20T10:30:00.000Z",
    "timeZoneOffset": 480,
    "array": [
      2019,
      8,
      20,
      10,
      30,
      0,
      0
    ],
    "year": 2019,
    "month": 8,
    "day": 20,
    "hour": 10,
    "minute": 30,
    "second": 0,
    "millisecond": 0
  },
  "end": null,
  "timeZone": "local",
  "localeCodes": [
    "en"
  ]
}

对于 timeGridWeek

{
  "date": {
    "marker": "2019-09-16T10:00:00.000Z",
    "timeZoneOffset": 480,
    "array": [
      2019,
      8,
      16,
      10,
      0,
      0,
      0
    ],
    "year": 2019,
    "month": 8,
    "day": 16,
    "hour": 10,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "start": {
    "marker": "2019-09-16T10:00:00.000Z",
    "timeZoneOffset": 480,
    "array": [
      2019,
      8,
      16,
      10,
      0,
      0,
      0
    ],
    "year": 2019,
    "month": 8,
    "day": 16,
    "hour": 10,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "end": {
    "marker": "2019-09-16T15:00:00.000Z",
    "timeZoneOffset": 480,
    "array": [
      2019,
      8,
      16,
      15,
      0,
      0,
      0
    ],
    "year": 2019,
    "month": 8,
    "day": 16,
    "hour": 15,
    "minute": 0,
    "second": 0,
    "millisecond": 0
  },
  "timeZone": "local",
  "localeCodes": [
    "en"
  ]
}

如果您想在 dayGrid(即 "month")视图中显示事件的结束时间,那么您可以简单地将 displayEventEnd 选项设置为 true:

displayEventEnd: true

演示:https://codepen.io/ADyson82/pen/qBWQOMR?&editable=true&editors=001

(N.B。不清楚 eventTimeFormat 与您的要求有何关系,或者您如何获得上述输出,因为 eventTimeFormat 是您在设置时传递给 fullCalendar 的选项向上,告诉它你希望如何显示个人 date/time(注意 如何 你希望它显示,而不是 是否 你希望它显示)。这不是您通常希望在任何其他时间访问的值。由于您没有提供代码,因此无论如何都不清楚您访问该数据的方式、地点或时间。无论哪种方式,它都无济于事实现你的目标。)