Skip to content

Commit

Permalink
Get startIndex from calculating day from props.start
Browse files Browse the repository at this point in the history
  • Loading branch information
theLAZYmd authored and theLAZYmd committed Apr 3, 2021
1 parent 5951865 commit cb47846
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ export interface CalendarFrameProps {
cell?: string
event?: string
}
startIndex?: number | string
maxEvents?: number
}

export function CalendarFrame(props: CalendarFrameProps) {

const days = props.dayLabels || defaultDayLabels;
const startIndex = typeof props.startIndex === 'string' ?
days.indexOf(props.startIndex) :
props.startIndex || 0;
const startIndex = new Date(props.start).getDay();
const maxEvents = props.maxEvents || 5;

const styles = useMemo(() => {
Expand Down

0 comments on commit cb47846

Please sign in to comment.