calendar icon indicating copy to clipboard operation
calendar copied to clipboard

resourceTimelineMultiMonth - new feature request

Open jasonladley opened this issue 1 year ago • 4 comments

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.

jasonladley avatar Nov 05 '24 14:11 jasonladley

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.

vkurko avatar Nov 11 '24 13:11 vkurko

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.

randolf avatar Nov 18 '24 20:11 randolf

@vkurko any updates please about integration of year and multi month views in the calendar? could you please set an ETA ? I can volunteer to help if necessary.

ml-kessoum avatar Feb 12 '25 08:02 ml-kessoum

could you please set an ETA ?

Sorry, there is no ETA for this feature yet. At the moment, all my library development capabilities are aimed at switching to Svelte 5. Only after that will it be possible to talk about implementing some new features. Thanks for understanding.

vkurko avatar Feb 17 '25 08:02 vkurko

I implemented a customized solution for this feature.

https://github.com/vkurko/calendar/issues/504#issuecomment-3080442157

rovshena avatar Jul 16 '25 20:07 rovshena