Kirby Recurr - a repeating dates plugin

A small plugin for generating repeating dates, like an events calendar, either directly or from field values. Comments and suggestions welcome.

1 Like

Would you mind giving a few simple examples how to use this with field data?

It is coming… i’m adding some blueprints etc to the plugin.

1 Like

@nilshoerrmann Just pushed an updated version that contains a blueprint and two new field methods becuase the frequency and the day list need to be in uppercase.

If you use the blue print in the plugin this should for you…

<?php $list = $site->recurr($page->estart(), $page->eend(), $page->efreq()->recurrfreq(), $page->ebyday()->recurrdays(), $page->erange()); ?>
<?php print_r($list) ?>
1 Like

I think there is one thing that irritates my, that I don’t get:
What’s the relation between the start/end date and the weekdays?

Ok so the first start and end is the single event start and end time. Then you have a a frequency which is weekly, and then days to repeat. So from the read me…

$datelist = $site->recurr('2019-09-10 20:00:00', '2019-09-11 02:00:00', 'WEEKLY', ['WE', 'TH', 'FR'], '2019-10-11');

Thats a gig that starts at 8pm and finishes at 2am the next day. It happens every week, on wednesdays, thursdays and fridays until 2019-10-11. Dumping that var will give you a list of dates for all the wednesdays, thursdays and fridays on every week for about a month between 2019-09-10 and 2019-10-11.

Hope that made sense!

The result is something like this… you get about 13 results back because it happens 3 times a week for about 4 weeks.

Array
(
    [0] => Array
        (
            [start] => 09-11-19 8:00pm
            [end] => 09-12-19 2:00am
        )

    [1] => Array
        (
            [start] => 09-12-19 8:00pm
            [end] => 09-13-19 2:00am
        )

    [2] => Array
        (
            [start] => 09-13-19 8:00pm
            [end] => 09-14-19 2:00am
        )

    [3] => Array
        (
            [start] => 09-18-19 8:00pm
            [end] => 09-19-19 2:00am
        )

    [4] => Array
        (
            [start] => 09-19-19 8:00pm
            [end] => 09-20-19 2:00am
        )

    [5] => Array
        (
            [start] => 09-20-19 8:00pm
            [end] => 09-21-19 2:00am
        )

    [6] => Array
        (
            [start] => 09-25-19 8:00pm
            [end] => 09-26-19 2:00am
        )

    [7] => Array
        (
            [start] => 09-26-19 8:00pm
            [end] => 09-27-19 2:00am
        )

    [8] => Array
        (
            [start] => 09-27-19 8:00pm
            [end] => 09-28-19 2:00am
        )

    [9] => Array
        (
            [start] => 10-02-19 8:00pm
            [end] => 10-03-19 2:00am
        )

    [10] => Array
        (
            [start] => 10-03-19 8:00pm
            [end] => 10-04-19 2:00am
        )

    [11] => Array
        (
            [start] => 10-04-19 8:00pm
            [end] => 10-05-19 2:00am
        )

    [12] => Array
        (
            [start] => 10-09-19 8:00pm
            [end] => 10-10-19 2:00am
        )

    [13] => Array
        (
            [start] => 10-10-19 8:00pm
            [end] => 10-11-19 2:00am
        )

)

Thanks!

I tried installing the recurr plugin to use it in a calendar project, but keep running into this debug message: “Class “Recurr\Transformer\ArrayTransformer” not found”.

I have already tested it in the plainkit to exclude other sources of error. The way I installed the plugin is by unzipping it into the “site/plugins/” folder. The panel entries for the calendar page are collected in a structure field using the event-field in the plugin, and in the frontend I tried displaying a simple repeat event with this line from the readme doc:

<?php $datelist = $site->recurr($page->estart(), $page->eend()->or($page->estart()), $page->efreq()->recurrfreq(), $page->ebyday()->recurrdays(), $page->erange()); ?>

Do you have any ideas what the problem could be?

This is my first time posting in the forum, so I hope this is the right way of handling this! Please tell me if I should open a separate thread instead.

Did you install it manually or via composer? Looks like I was daft and left the vendor folder out of the repo so manual install probably work, which it looks like you did that.

Can you install via composer? i can update github with the vendor folder included, but that might take me a day or 2 to get to.

p.s Welcome to the forum :slight_smile:

Hey @jimbobrjames, thank you for the super quick reply and the welcome :slight_smile:

Exactly, I installed it manually just by copying it into the plugins folder. I’ll try the composer way first then and come back to you if I can’t figure it out or it still doesn’t work.

Have a nice evening!

@Ernst_Wolf No problem… i just pushed a new release with the Vendor folder there so that manual installs will work. However in general, i would recommend using composer to install plugins and keeping Kirby up to date.

1 Like