Commit 53e542e1 authored by Mingsong's avatar Mingsong
Browse files

Issue #3323784 by Jacoboa, jolimas, mingsong: Add Slot Duration option to...

parent 810e1bc1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ class FullcalendarViewPreprocess {
    $left_buttons = Xss::filter($options['left_buttons']);
    // Right side buttons.
    $right_buttons = Xss::filter($options['right_buttons']);
    // Slot Duration.
    $slot_duration = empty($options['slotDuration']) ? '00:30:00' : Xss::filter($options['slotDuration']);
    $entries = [];

    if (!empty($start_field)) {
@@ -349,6 +351,7 @@ class FullcalendarViewPreprocess {
        // Limits the number of events displayed on a day.
        'eventLimit' => isset($options['eventLimit']) ? intval($options['eventLimit']) : 2,
        'eventOverlap' => $options['allowEventOverlap'] !== 0,
        'slotDuration' => $slot_duration,
      ];
      // Dialog options.
      // Other modules can override following options by custom plugin.
+10 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ class FullCalendarDisplay extends StylePluginBase {
    $options['createEventLink'] = ['default' => 0];
    $options['openEntityInNewTab'] = ['default' => 1];
    $options['eventLimit'] = ['default' => 2];
    $options['slotDuration'] = ['default' => '00:30:00'];
    return $options;
  }

@@ -396,6 +397,15 @@ class FullCalendarDisplay extends StylePluginBase {
      '#title' => $this->t('Legend Colors'),
      '#description' => $this->t('Set color value of legends for each content type or each taxonomy.'),
    ];
    $form['slotDuration'] = [
      '#type' => 'textfield',
      '#fieldset' => 'display',
      '#title' => $this->t('Slot duration'),
      '#description' => $this->t('The frequency for displaying time slots.'),
      '#size' => 8,
      '#maxlength' => 8,
      '#default_value' => (isset($this->options['slotDuration'])) ? $this->options['slotDuration'] : '00:30:00',
    ];

    $moduleHandler = \Drupal::service('module_handler');
    if ($moduleHandler->moduleExists('taxonomy')) {