function _webform_table_time in Webform 6.3
Same name and namespace in other branches
- 7.4 components/time.inc \_webform_table_time()
- 7.3 components/time.inc \_webform_table_time()
Implements _webform_table_component().
File
- components/
time.inc, line 363 - Webform module time component.
Code
function _webform_table_time($component, $value) {
if ($value[0]) {
$time = webform_date_array($value[0], 'time');
if ($component['extra']['hourformat'] == '24-hour') {
return sprintf('%02d', $time['hour']) . ':' . sprintf('%02d', $time['minute']);
}
else {
$time = webform_time_convert($time, '12-hour');
return $time['hour'] . ':' . sprintf('%02d', $time['minute']) . ' ' . $time['ampm'];
}
}
else {
return '';
}
}