Skip to content

Instantly share code, notes, and snippets.

@tararoutray
Last active May 29, 2023 01:37
Show Gist options
  • Save tararoutray/21df93abc946e8d5edf1de505b070c9d to your computer and use it in GitHub Desktop.
Save tararoutray/21df93abc946e8d5edf1de505b070c9d to your computer and use it in GitHub Desktop.
import { Component, OnInit } from "@angular/core";
@Component({
selector: "app-tasks",
templateUrl: "./tasks.component.html",
styleUrls: ["./tasks.component.css"],
})
export class TasksComponent implements OnInit {
rowData: any[];
columnDefs: any[];
defaultColDef: any;
ngOnInit() {
this.rowData = [
{ name: "Task 1", start_date: "2023-05-29 06:00:00", end_date: "2023-06-20 06:00:00" },
{ name: "Task 2", start_date: "2023-05-30 06:00:00", end_date: "2023-06-21 06:00:00" },
{ name: "Task 3", start_date: "2023-05-31 06:00:00", end_date: "2023-06-22 06:00:00" },
// Add more data as needed
];
this.columnDefs = [
{ headerName: "Task Name", field: "name" },
{ headerName: "Start Date", field: "start_date" },
{ headerName: "End Date", field: "end_date" },
// Add more columns as needed
];
this.defaultColDef = {
sortable: true,
filter: true,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment