diff --git a/src/Entity/EventSeries.php b/src/Entity/EventSeries.php index b11a32c40b093742671a6e1b81913f84399fa702..d64d46c60c1c5583b09b65a825e88dc0f16940bf 100644 --- a/src/Entity/EventSeries.php +++ b/src/Entity/EventSeries.php @@ -400,13 +400,18 @@ class EventSeries extends EditorialContentEntityBase implements EventSeriesInter $fields['custom_date'] = BaseFieldDefinition::create('daterange') ->setLabel(t('Custom Date')) - ->setDescription('The custom, date configuration.') + ->setDescription('The custom date configuration.') ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) ->setRevisionable(TRUE) ->setTranslatable(FALSE) ->setCardinality(-1) - ->setRequired(FALSE); + ->setRequired(FALSE) + ->setDisplayOptions('form', [ + 'type' => 'daterange_default', + 'label' => 'above', + 'weight' => 4, + ]); $fields['instances'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Events in this Series')) diff --git a/src/Form/EventSeriesForm.php b/src/Form/EventSeriesForm.php index cbef12e7e040d78d10148808fbc3a0e49778fbd4..129a30ae294a7f5bc039448807897b99653b1eb4 100644 --- a/src/Form/EventSeriesForm.php +++ b/src/Form/EventSeriesForm.php @@ -21,6 +21,12 @@ class EventSeriesForm extends ContentEntityForm { /* @var $entity \Drupal\recurring_events\Entity\EventSeries */ $entity = $this->entity; + $form['custom_date']['#states'] = [ + 'visible' => [ + ':input[name="recur_type"]' => ['value' => 'custom'], + ], + ]; + $form['advanced']['#attributes']['class'][] = 'entity-meta'; $form['meta'] = [ diff --git a/src/Plugin/Field/FieldWidget/MonthlyRecurringDateWidget.php b/src/Plugin/Field/FieldWidget/MonthlyRecurringDateWidget.php index 62ee3a9c05c27b9dbd89401afca91c972d5c6f9a..6a8d33727597fec9c37bd077a829daa11b13ed7c 100644 --- a/src/Plugin/Field/FieldWidget/MonthlyRecurringDateWidget.php +++ b/src/Plugin/Field/FieldWidget/MonthlyRecurringDateWidget.php @@ -44,7 +44,7 @@ class MonthlyRecurringDateWidget extends WeeklyRecurringDateWidget { ]; $element['day_occurrence'] = [ - '#type' => 'radios', + '#type' => 'checkboxes', '#title' => t('Day Occurrence'), '#options' => [ 'first' => t('First'),