elabx / fieldtype-recurring-dates
Field to setup recurring dates using RRule
Installs: 2 106
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 1
Open Issues: 7
Type:pw-module
Requires
- php: >=7.3
- elabx/processwire-alpinejs: dev-main
- rlanvin/php-rrule: ^2.3
- wireframe-framework/processwire-composer-installer: ^1.1
This package is auto-updated.
Last update: 2024-10-19 15:22:36 UTC
README
This is a pre-release please do not use in production.
FieldtypeRecurringDates
Fieldtype and Inputfield for definining recurring dates according to RFC-RFC 5545 and the awesome library php-rrule
Installation
composer require elabx/fieldtype-recurring-dates
Make sure to install both FieldtyeRecurringDates and AlpineJS modules. Additionally you may install RecurringDatesFinder for search operations.
Or download through the processwire modules directory.
This module will save the RRules occurrences in the database to be queried later.
Find pages with fields
Use date values valid for date selectors.
$pages->find('recurring_meetings=>today')
Finding occurrences
You can use the module included in this same package to find the rules occurrences:
$start
and $end
value are any acceptable value for $datetime
$finder = $modules->get('ReccurringDatesFinder')
$output = $finder->find(
// from date
'today',
// to date
'+30 days',
$selector, [
'fields' => [ // Will find event occurrences in fields specified in this array
'recurring_meetings',
'recurring_events'
]
]
This method will return the SQL UNION result of specified fields.
You can also hook into getRecurringFieldQueries() to add queries that will get added to the final UNION query.
TODO
- Add support for BYSETPOS
- Add support for 'Never' option.
Wishlist
- Support for plain text RRule.
- Add support for BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYMINUTE, BYHOUR, BYMINUTE, BYSECOND .
- Add support to modify RRule before saving? Maybe skips
- Use RSet instead of RRule?