Browse Source

fix default value on date picker field: https://www.drupal.org/project/reserve/issues/3047690

8.x-1.x
Peter Lindstrom 6 years ago
parent
commit
7a3dc10dd4
  1. 2
      src/Form/CalendarDatePicker.php

2
src/Form/CalendarDatePicker.php

@ -32,7 +32,7 @@ class CalendarDatePicker extends FormBase {
'#description' => $this->t('Click in box to select date.'),
];
if (count($path_args) == 5) {
if (count($path_args) >= 5) {
$date = date('Y') . '-' . $path_args[4] . '-' . $path_args[5];
$form['date']['#default_value'] = $date;
}

Loading…
Cancel
Save