Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resourceTimelineMultiMonth - new feature request #373

Open
jasonladley opened this issue Nov 5, 2024 · 2 comments
Open

resourceTimelineMultiMonth - new feature request #373

jasonladley opened this issue Nov 5, 2024 · 2 comments

Comments

@jasonladley
Copy link

I've been using this calendar for a bit and I've really enjoyed working with it! Recently I was looking for a way to display 2 months or 3 months worth of resource data at a time. I found I could do so by modifying the code (event-calendar.min.js) a bit to add in a new view but was wondering if you'd consider making this an official view everyone could use in a future release? My changes were simple and are shown below:

I added

t.buttonText.resourceTimelineMultiMonth = "timeline 2 months",

and further into the code I define that view and set it's months to 2

t.views.resourceTimelineMultiMonth = {
                buttonText: Le,
                component: ii,
                displayEventEnd: !1,
                dayHeaderFormat: {
                    weekday: "short",
                    day: "numeric"
                },
                duration: {
                    months: 2
                },
                slotDuration: {
                    days: 1
                },
                theme: Re("ec-timeline ec-resource-month-view"),
                titleFormat: {
                    year: "numeric",
                    month: "long"
                }
            }

Now when initializing my calendar I have views like this:

views: {
            resourceTimeGridWeek: {pointer: true},
            resourceTimelineMonth: {
                pointer: true,
                slotWidth: 80,
                resources: resourcesObjectsByJobSet
            },
            resourceTimelineMultiMonth: {
                pointer: true,
                slotWidth: 80,
                resources: resourcesObjectsByJobSet
                },
}

my header toolbar was updated to support the resourceTimelineMultiMonth view

        headerToolbar: {
            start: 'prev,next today',
            center: 'title',
            end: 'resourceTimeGridWeek,resourceTimelineMonth,resourceTimelineMultiMonth'
        }

Any potential issues updating the calendar to add a view like resourceTimelineMultiMonth officially? My use case for this was users asking me to have a way to view data from the previous month on their calendar without clicking back a month. They wanted to click and drag to expand events into future months. for example from November into December. At the moment this isn't possible, but viewing multiple months at a time would allow for this operation.

@vkurko
Copy link
Owner

vkurko commented Nov 11, 2024

Thank you for sharing your code. Indeed, there is currently a lack of an official way to add your own views. I will think about making such an option available.

@randolf
Copy link

randolf commented Nov 18, 2024

Please consider a year-long view as well as multi-year view. These views obviously won't be able to show event-specific detail, but they could indicate (e.g., with a solid colour) that something is scheduled on that day.

For the multi-year view, each month could be displayed in a manner that shows a solid colour that's stronger when there are more events in them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants