Neura UI

Loading…

 Logo

Recurrence

Set how an event repeats, in plain words or with the controls, and see its next dates. The value is an RRULE.

Basic Usage

Type the repetition in plain words (French or English) and press Enter, pick a suggestion, or set it with the controls. The value is an RRULE (RFC 5545) that libraries such as rlanvin/php-rrule or rrule.js read as they are.
blade

Not understood. Try “every 2 weeks on Tuesday”.

Repeat
On
Day of the month
Date
Time
Ends
times
Summary

Next dates

No upcoming date with this rule.

Rule
"FREQ=WEEKLY;BYDAY=MO,TH;BYHOUR=9;BYMINUTE=0"
<neura::recurrence wire:model.live="rule" show-rule />
<!-- $rule will be 'FREQ=WEEKLY;BYDAY=MO,TH;BYHOUR=9;BYMINUTE=0' -->

Optional

optional adds a None choice, and an empty value means no repetition. Without it, an empty value takes the default rule, so what the editor shows is what the model holds.
blade

Not understood. Try “every 2 weeks on Tuesday”.

Repeat
On
Day of the month
Date
Time
Ends
times
Summary

Next dates

No upcoming date with this rule.

""
<neura::recurrence wire:model="reminder" optional :preview="3" />

Compact

Leave out what a form does not need: the frequencies, the field in words, the time, the end or the preview. The editor stacks itself in a narrow column.
blade
Repeat
On
Day of the month
Ends
times
<neura::recurrence :frequencies="['weekly', 'monthly']" :natural="false"
    :time="false" :preview="0" :summary="false" size="sm" />

Configuration

Defaults live in config/neura-kit.php, like the other components. A prop on the tag wins over them.
php
'recurrence' => Config::recurrence([
    'default' => [
        'size' => 'md',        // sm | md | lg (pack: Recurrence\Size)
        'rounded' => 'global',
        'natural' => true,     // the field in plain words
        'preview' => 5,        // upcoming dates listed, 0 hides them
    ],
]),
'recurrence' => Config::recurrence([
    'default' => [
        'size' => 'md',        // sm | md | lg (pack: Recurrence\Size)
        'rounded' => 'global',
        'natural' => true,     // the field in plain words
        'preview' => 5,        // upcoming dates listed, 0 hides them
    ],
]),

Props

Prop Type Default Description
value / wire:model string '' An RRULE without DTSTART: FREQ=WEEKLY;BYDAY=MO,TH;BYHOUR=9;BYMINUTE=0
start date today First day of the series, for the dates and the defaults
frequencies array all four daily, weekly, monthly, yearly
natural boolean config: true The field where the repetition is typed in words
suggestions array|false built-in Sentences under the field
time boolean true A time of day (BYHOUR, BYMINUTE)
ends boolean true Never, on a date (UNTIL) or after a count (COUNT)
optional boolean false A None choice; an empty value means no repetition
preview int config: 5 Upcoming dates listed
summary / showRule boolean true / false The sentence and the RRULE beside the editor
maxInterval int 99 Largest interval
locale / hourCycle string / 12|24 app locale Words, first weekday and clock
name string null Hidden input for plain form posts
size / rounded string config From config(neura-kit.recurrence)
disabled boolean false