Update documentation example

Created on 28 July 2025, 14 days ago

Problem/Motivation

The module page documentation shows an example with some small mistakes on it.

Proposed resolution

The example should use DateRangePickerOptions and all the children parameters should use syntax.

$element['range'] = [
  '#type' => 'daterangepicker',
  '#DateRangePickerOptions' => [
    'initial_text' => t('Select date range...'),
    'apply_button_text' => t('Apply'),
    'clear_button_text' => t('Clear'),
    'cancel_button_text' => t('Cancel'),
    'range_splitter' => ' - ',
    'date_format' => 'd M, yy',
    // This needs to be a format recognised by javascript Date.parse method.
    'alt_format' => 'yy-mm-dd',
    'date_picker_options' => [
      'number_of_months' => 2,
    ],
  ],
];
🐛 Bug report
Status

Active

Version

1.0

Component

Documentation

Created by

🇪🇸Spain pakmanlh Barcelona

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024