From 6555060f49081d508919f2060b35210ff5435571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20San=20Miguel=20Garc=C3=ADa?= Date: Sun, 5 Mar 2023 19:47:46 -0600 Subject: [PATCH] added readme. added dockblock to function --- README.md | 21 ++++++++++++++++++- .../RecurringDatesFinder.module | 11 +++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5c2cd3..0965285 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ +This is a pre-release please do not use in production. + # FieldtypeRecurringDates -To do. +Fieldtype for definining recurring dates according to [RFC-RFC 5545)](https://www.rfc-editor.org/rfc/rfc5545#section-3.3.10) and the awesome library +[php-rrule](https://github.com/rlanvin/php-rrule) + +# Finding occurrences + +You can use the module included in this same package to find the rules occurrences: + +``` +$output = $calendarRenderer->render( + $selector, [ + 'fields' => [ + // Will find event occurrences in fields specified in this array + 'recurring_meetings', + 'recurring_events' + ] + ] +``` + diff --git a/RecurringDatesFinder/RecurringDatesFinder.module b/RecurringDatesFinder/RecurringDatesFinder.module index 1c5c73f..7b1319c 100644 --- a/RecurringDatesFinder/RecurringDatesFinder.module +++ b/RecurringDatesFinder/RecurringDatesFinder.module @@ -77,7 +77,16 @@ class RecurringDatesFinder extends WireData implements Module return $field_queries; } - + + /** + * @param $start string|int + * @param $end string|int + * @param $selector string + * @param $options array + * - `fields` (string) : Selector. + * @return array|false + * @throws WireException + */ public function find($start, $end, $selector = null, $options = array()) { $field_queries = $this->getRecurringFieldQueries($start, $end, $selector, $options);