Skip to content

Commit

Permalink
refactor: 💡 [Timeline] Currently switch back to start/end unit
Browse files Browse the repository at this point in the history
  • Loading branch information
luciob committed Oct 26, 2023
1 parent a551ddf commit 3f5415d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/grid/Cells/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import React, { memo } from "react";
import { KonvaGroup } from "../../@konva";
import { useTimelineContext } from "../../timeline/TimelineContext";
import GridCell from "../Cell";
import GridCellGroup from "../CellGroup";
// import GridCellGroup from "../CellGroup";

interface GridCellsProps {
height: number;
}

const GridCells = ({ height }: GridCellsProps) => {
const { aboveTimeBlocks, visibleTimeBlocks } = useTimelineContext();
const { /*aboveTimeBlocks,*/ visibleTimeBlocks } = useTimelineContext();

return (
<KonvaGroup>
{aboveTimeBlocks.map((column, index) => (
{/* {aboveTimeBlocks.map((column, index) => (
<GridCellGroup key={`cell-group-${index}`} column={column} height={height} index={index} />
))}
))} */}
{visibleTimeBlocks.map((column, index) => (
<GridCell key={`cell-${index}`} column={column} height={height} index={index} />
))}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const getIntervalFromInternalTimeRange = (
timezone: string | undefined
): Interval => {
const tz = timezone || "system";
const startDateTime = DateTime.fromMillis(start, { zone: tz }).startOf(resolution.unitAbove);
const endDateTime = DateTime.fromMillis(end, { zone: tz }).endOf(resolution.unitAbove);
const startDateTime = DateTime.fromMillis(start, { zone: tz }).startOf(resolution.unit);
const endDateTime = DateTime.fromMillis(end, { zone: tz }).endOf(resolution.unit);
return Interval.fromDateTimes(startDateTime, endDateTime);
};

0 comments on commit 3f5415d

Please sign in to comment.