saade / filament-fullcalendar

The Most Popular JavaScript Calendar as a Filament Widget
MIT License
295 stars 88 forks source link

Enhancement: Custom FullCalendar Configuration for Widgets #130

Closed sitenzo closed 8 months ago

sitenzo commented 1 year ago

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.

saade commented 1 year ago

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

StaffCollab commented 11 months ago

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,
                ]),
        ];
    }
lukas-frey commented 9 months ago

Any news on this PR? :)

GeoSot commented 9 months ago

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

GeoSot commented 9 months ago

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

saade commented 9 months ago

I'll have a look later today 👍🏼

sitenzo commented 9 months ago

I have committed all the changes you have reviewed.

GeoSot commented 9 months ago

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

Sjoerd24 commented 8 months ago

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 👍

saade commented 8 months ago

Thanks!