Commit 82e3cfd6 authored by ramya balasubramanian's avatar ramya balasubramanian Committed by SUDISHTH KUMAR
Browse files

Issue #2947426 by darrick, Ramya Balasubramanian, sudishth: Rename "Date range...

Issue #2947426 by darrick, Ramya Balasubramanian, sudishth: Rename "Date range (without time)" formatter
parent a1bbc677
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -5,12 +5,6 @@ field.formatter.settings.date_range_without_time:
    separator:
      type: string
      label: 'Separator'
    single:
      type: date_format
      label: 'Date format for single date'
    single_all_day:
      type: date_format
      label: 'Date format for the single date if the date is "all day"'
    one_day:
      type: date_format
      label: 'Date format for the single day date range'
+2 −16
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ use Drupal\datetime_range\DateTimeRangeTrait;
 *
 * @FieldFormatter(
 *   id = "date_range_without_time",
 *   label = @Translation("Date range (without time)"),
 *   label = @Translation("Date range"),
 *   field_types = {
 *     "daterange"
 *   }
@@ -31,8 +31,6 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
  public static function defaultSettings() {
    return [
      'separator' => '-',
      'single' => 'd F Y',
      'single_all_day' => 'd F Y',
      'one_day' => 'd F Y',
      'one_month' => 'd - {d} F Y',
      'several_months' => 'd F - {d} {F} Y',
@@ -93,16 +91,6 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
  public function settingsForm(array $form, FormStateInterface $form_state) {
    $form = parent::settingsForm($form, $form_state);
    unset($form['date_format']);
    $form['single'] = [
      '#type' => 'textfield',
      '#title' => t('Date format for single date'),
      '#default_value' => $this->getSetting('single') ? : 'd F Y',
    ];
    $form['single_all_day'] = [
      '#type' => 'textfield',
      '#title' => t('Date format for the single date if the date is "all day"'),
      '#default_value' => $this->getSetting('single_all_day') ? : 'd F Y',
    ];
    $form['one_day'] = [
      '#type' => 'textfield',
      '#title' => t('Date format for the single day date range'),
@@ -138,10 +126,8 @@ class DateRangeFormatterRangeFormatter extends DateTimeCustomFormatter {
   */
  public function settingsSummary() {
    $summary = parent::settingsSummary();
    $summary[] = $this->t('Display date range using formats: @single, @single_all_day, @one_day, @one_month, @several_months, @several_years',
    $summary[] = $this->t('Display date range using formats: @one_day, @one_month, @several_months, @several_years',
        array(
          '@single' => $this->getSetting('single') ? : 'd F Y',
          '@single_all_day' => $this->getSetting('single_all_day') ? : 'd F Y',
          '@one_day' => $this->getSetting('one_day') ? : 'd F Y',
          '@one_month' => $this->getSetting('one_month') ? : 'd - {d} F Y',
          '@several_months' => $this->getSetting('several_months') ? : 'd F - {d} {F} Y',