Is there any way to add time range input fields in a form, for example using code similar to the following one?
$form['notification_hours'] = array(
'#type' => 'time_range', // type time_range doesn't work
'#title' => $this->t('Notification hours:'),
'#default_value' => $config->get('ecc_general.notification_hours'),
'#description' => $this->t('what are the hours that messages should not be sent?'),
);
I have tried the Time Range and and Time Field modules. I'm able to add the time range field, but I failed to programmatically create it.