Skip to content
Snippets Groups Projects

Issue #3221245 by ckng: Option to display start date only

Open Chin Kiong Ng requested to merge issue/smart_date-3221245:3.3.x into 3.3.x
2 files
+ 19
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -39,6 +39,7 @@ class SmartDateDefaultFormatter extends DateTimeDefaultFormatter {
'force_chronological' => 0,
'add_classes' => 0,
'time_wrapper' => 1,
'start_date_only' => 0,
] + parent::defaultSettings();
}
@@ -93,6 +94,14 @@ class SmartDateDefaultFormatter extends DateTimeDefaultFormatter {
'#default_value' => $this->getSetting('time_wrapper'),
];
// Provide an option to display start date only.
$form['start_date_only'] = [
'#type' => 'checkbox',
'#title' => $this->t('Display start date only.'),
'#description' => $this->t('Display start date value only, i.e. hide the end date on display.'),
'#default_value' => $this->getSetting('start_date_only'),
];
return $form;
}
Loading