Skip to content

Commit

Permalink
refactor: 💡 Added type for HourInfo and DayInfo
Browse files Browse the repository at this point in the history
✅ Closes: #140
  • Loading branch information
CrisGrud committed Nov 6, 2023
1 parent 9e8d987 commit 982e645
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/grid/Cells/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import { Interval } from "luxon";

import { daysInMonth, getMonth, getStartMonthsDay, getYear, Scale } from "../../utils/time-resolution";

interface visibleDayInfoProps {
interface VisibleHourInfoProps {
backHour?: boolean;
nextHour?: boolean;
}

interface DayDetailProps {
thisMonth?: number;
untilNow?: number;
}

export const timeBlockTz = (timeBlock: Interval[], initialTz?: string) => {
const dayInfoArray: visibleDayInfoProps[] = [];
const dayInfoArray: VisibleHourInfoProps[] = [];
timeBlock.forEach((column) => {
const tzStart = column.start!.toISO()?.slice(-6);

Expand Down Expand Up @@ -36,10 +41,7 @@ export const timeBlockTz = (timeBlock: Interval[], initialTz?: string) => {

export const dayDetail = (unitAbove: Scale, aboveTimeBlocks: Interval[], interval: Interval) => {
if (unitAbove === "month") {
const dayInfo: {
thisMonth?: number;
untilNow?: number;
}[] = [];
const dayInfo: DayDetailProps[] = [];
aboveTimeBlocks.forEach((column, index) => {
const month = getMonth(column);
const year = getYear(column);
Expand Down

0 comments on commit 982e645

Please sign in to comment.