Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 时间线-数据列表不显示在日历上_Javascript_Angular_Typescript_Devextreme - Fatal编程技术网

Javascript 时间线-数据列表不显示在日历上

Javascript 时间线-数据列表不显示在日历上,javascript,angular,typescript,devextreme,Javascript,Angular,Typescript,Devextreme,我打算开发一个从数据源加载所有数据/事件的时间线。 我正在使用一个devextreme组件来开发时间线,但是事件不会出现在日历上。我可能做错了什么 有人能帮我吗 多谢各位 html <dx-scheduler timeZone="America/Los_Angeles" [dataSource]="myDatasource" [views]='["timelineDay", "timeline

我打算开发一个从数据源加载所有数据/事件的时间线。 我正在使用一个devextreme组件来开发时间线,但是事件不会出现在日历上。我可能做错了什么

有人能帮我吗

多谢各位

html

<dx-scheduler
    timeZone="America/Los_Angeles"
    [dataSource]="myDatasource"
    [views]='["timelineDay", "timelineWeek", "timelineWorkWeek", "timelineMonth"]'
    currentView="timelineMonth"
    [firstDayOfWeek]="0"
    [startDayHour]="8"
    [endDayHour]="20"
    [cellDuration]="60"
    [groups]="['idUser']"
    [currentDate]="currentDate"
    [height]="580">
    <dxi-resource
        fieldExpr="idUser"
        [allowMultiple]="true"
        [dataSource]="myDatasource"
        label="Owner"
        [useColorAsDefault]="true"
    ></dxi-resource>
</dx-scheduler>

更改您的服务

  date:"2021-02-03T16:00:00.000Z",
  deadline:"2021-02-04T16:00:00.000Z"

  startDate:"2021-02-03T16:00:00.000Z",
  endDate:"2021-02-04T16:00:00.000Z"
import { Component, VERSION } from "@angular/core";

@Component({
  selector: "my-app",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  currentDate: Date = new Date();
  myDatasource = [
    {
      id: 1,
      idUser: 1,
      name: "name1",
      startDate: new Date("2021-02-01T16:00:00.000Z"),
      endDate: new Date("2021-02-04T16:00:00.000Z"),
      priority: 1,
      color: "#cb6bb2"
    },
  ...
  ];
}