Bitnoise / react-scheduler

MIT License
327 stars 92 forks source link

Incorrect import in @bitnoi.se/react-scheduler README example code #165

Open Deepan-kishore opened 5 days ago

Deepan-kishore commented 5 days ago

I encountered an issue with the example code provided in the @bitnoi.se/react-scheduler README. It seems that there are missing imports and setup that result in errors when trying to run the example.

Steps to Reproduce:

default export function Component() { const [filterButtonState, setFilterButtonState] = useState(0);

const [range, setRange] = useState({ startDate: new Date(), endDate: new Date() });

const handleRangeChange = useCallback((range) => { setRange(range); }, []);

const filteredMockedSchedulerData = mockedSchedulerData.map((person) => ({ ...person, data: person.data.filter( (project) => dayjs(project.startDate).isBetween(range.startDate, range.endDate) || dayjs(project.endDate).isBetween(range.startDate, range.endDate) || (dayjs(project.startDate).isBefore(range.startDate, "day") && dayjs(project.endDate).isAfter(range.endDate, "day")) ) }))

return (

console.log(clickedResource)} onItemClick={(item) => console.log(item)} onFilterData={() => setFilterButtonState(1)} onClearFilterData={() => setFilterButtonState(0)} config={{ zoom: 0, filterButtonState }} />

); }

const mockedSchedulerData = [...] // Same as the example data in the README `

Deepan-kishore commented 5 days ago

I could not assign this to anyone. The option shows to be disabled for me.

Deepan-kishore commented 5 days ago

For some reason, when I create a separate TS project from scratch and use the example in readme.md, this issue arises. But it's working fine when I clone it from this Repository.