function _webform_display_time in Webform 7.3
Same name and namespace in other branches
- 6.3 components/time.inc \_webform_display_time()
- 7.4 components/time.inc \_webform_display_time()
Implements _webform_display_component().
File
- components/
time.inc, line 294 - Webform module time component.
Code
function _webform_display_time($component, $value, $format = 'html') {
$value = webform_date_array(isset($value[0]) ? $value[0] : '', 'time');
if ($component['extra']['hourformat'] == '12-hour') {
$value = webform_time_convert($value, '12-hour');
}
return array(
'#title' => $component['name'],
'#weight' => $component['weight'],
'#theme' => 'webform_display_time',
'#theme_wrappers' => $format == 'html' ? array(
'webform_element',
) : array(
'webform_element_text',
),
'#format' => $format,
'#hourformat' => $component['extra']['hourformat'],
'#value' => $value,
'#translatable' => array(
'title',
),
);
}