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!