Hi Samir,
With the following setup, the resource calendar will display one day on the vertical axis. As the startDate
is not specified, it will use the current day for all columns/resources.
<DayPilotCalendar
viewType="Resources"
controlRef={setCalendar}
columns={[
{ name: "Resource A", id: "A" },
{ name: "Resource B", id: "B" },
{ name: "Resource C", id: "C" },
{ name: "Resource D", id: "D" },
{ name: "Resource E", id: "E" },
{ name: "Resource F", id: "F" },
{ name: "Resource G", id: "G" }
]}
heightSpec="BusinessHoursNoScroll"
businessBeginsHour={9}
businessEndsHour={17}
/>
The events
array only contains events in a range from May 2 to May 5, 2024.
const events = [
{
id: 1,
text: "Event 1",
start: "2024-05-02T00:00:00",
end: "2024-05-05T00:00:00",
resource: "A",
owner: "AB"
},
{
id: 2,
text: "Event 2",
start: "2024-05-03T00:00:00",
end: "2024-05-05T00:00:00",
resource: "C",
barColor: "#5bbe2d",
barBackColor: "#93c47d",
owner: "BK"
},
{
id: 3,
text: "Event 3",
start: "2024-05-02T00:00:00",
end: "2024-05-04T00:00:00",
resource: "D",
barColor: "#f1c232",
barBackColor: "#f1c232",
owner: "FH"
},
{
id: 4,
text: "Event 3",
start: "2024-05-02T00:00:00",
end: "2024-05-04T00:00:00",
resource: "E",
barColor: "#cc4125",
barBackColor: "#ea9999",
owner: "IG"
}
];
console.log(events);
const columns = [
{ name: "Resource A", id: "A" },
{ name: "Resource B", id: "B" },
{ name: "Resource C", id: "C" },
{ name: "Resource D", id: "D" },
{ name: "Resource E", id: "E" },
{ name: "Resource F", id: "F" },
{ name: "Resource G", id: "G" }
];
calendar.update({ events, columns });
If you change the date to "2024-05-02", you should see events in columns A, D, and E.
<DayPilotCalendar
viewType="Resources"
startDate={"2024-05-02"}
controlRef={setCalendar}
columns={[
{ name: "Resource A", id: "A" },
{ name: "Resource B", id: "B" },
{ name: "Resource C", id: "C" },
{ name: "Resource D", id: "D" },
{ name: "Resource E", id: "E" },
{ name: "Resource F", id: "F" },
{ name: "Resource G", id: "G" }
]}
heightSpec="BusinessHoursNoScroll"
businessBeginsHour={9}
businessEndsHour={17}
/>
Another option is to change the scale to display the full month.
Example:
<DayPilotCalendar
startDate={"2024-05-01"}
days={31}
scale={"Day"}
// ...
/>
Let me know if the problem persists.