You are here

function timefield_build_time_format in Timefield 7

Same name and namespace in other branches
  1. 1.0.x timefield.module \timefield_build_time_format()

Helper function to build time format settings appropriate for use with PHP date function.

1 call to timefield_build_time_format()
timefield_integer_to_time in ./timefield.module
Helper function to return time value from a timefield integer.

File

./timefield.module, line 957
Defines a Field API field for time

Code

function timefield_build_time_format($settings) {
  $format = $settings['hour'];
  $format .= $settings['minute'] == 'none' ? '' : $settings['separator'] . $settings['minute'];
  $format .= $settings['period'] == 'none' ? '' : $settings['period_separator'] . $settings['period'];
  return $format;
}