mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
15 lines
447 B
TypeScript
15 lines
447 B
TypeScript
|
// types
|
||
|
import { IIssue } from "types";
|
||
|
import { IGanttBlock } from "components/gantt-chart";
|
||
|
|
||
|
export const renderIssueBlocksStructure = (blocks: IIssue[]): IGanttBlock[] =>
|
||
|
blocks && blocks.length > 0
|
||
|
? blocks.map((block) => ({
|
||
|
data: block,
|
||
|
id: block.id,
|
||
|
sort_order: block.sort_order,
|
||
|
start_date: new Date(block.start_date ?? ""),
|
||
|
target_date: new Date(block.target_date ?? ""),
|
||
|
}))
|
||
|
: [];
|