filament-fullcalendar icon indicating copy to clipboard operation
filament-fullcalendar copied to clipboard

Enhancement: Custom FullCalendar Configuration for Widgets

Open sitenzo opened this issue 1 year ago • 2 comments

In this pull request, we're introducing a feature that allows you to customize the FullCalendar configuration on a per-widget basis.

What's New?

You can now set a default configuration at the plugin level. However, if you need to make specific changes for a particular widget, you have the flexibility to do so.

How to Customize Widget Configuration?

In your widget, implement the getConfig method.

public function getConfig(): array {
    return [
        // Your custom FullCalendar configuration settings go here
    ];
}

Set up the custom configuration for the widget within the getConfig method.

Merging Configurations

Behind the scenes, both the default plugin configuration and the widget-specific configuration files are merged into one final configuration for the widget. This ensures that you have full control over how FullCalendar behaves for each widget.

We believe this enhancement will provide greater flexibility and customization options for your FullCalendar widgets.

sitenzo avatar Nov 22 '23 21:11 sitenzo

Hey! Thanks for your contribution, i'll review it soon :)

saade avatar Nov 28 '23 12:11 saade

Hello. This is a very needed feature! I want to customize the hidden days and times per user to only show the available times to book sessions on a per-caregiver availability basis.

This would be wonderful.

    protected function getFooterWidgets(): array
    {
        return [
            CalendarWidget::make()
                ->config([
                    'hiddenDays' => $this->record->notAvailableDays,
                ]),
        ];
    }

StaffCollab avatar Dec 29 '23 01:12 StaffCollab

Any news on this PR? :)

lukas-frey avatar Feb 19 '24 20:02 lukas-frey

@saade can we help, in order to merge this?

GeoSot avatar Mar 01 '24 17:03 GeoSot

I am not sure if any other than @sitenzo can edit this PR

GeoSot avatar Mar 01 '24 18:03 GeoSot

I'll have a look later today 👍🏼

saade avatar Mar 01 '24 19:03 saade

I have committed all the changes you have reviewed.

sitenzo avatar Mar 02 '24 10:03 sitenzo

array_merge_recursive, maybe is not the perfect solution here Possible help: https://copyprogramming.com/howto/php-merge-arrays-with-only-not-duplicated-values

Edit: @saade, supposing you bing back mergeArraysRecursive, from the initial commit, it will be fine to go

GeoSot avatar Mar 02 '24 15:03 GeoSot

Any news on this pull request? This option would be extremely useful for me :) I think with the suggestion of @GeoSot to bring back mergeArraysRecursive the PR should be fine right? Looks good to my eye at least 👍

Sjoerd24 avatar Mar 23 '24 05:03 Sjoerd24

Thanks!

saade avatar Mar 26 '24 17:03 saade