You are here

function theme_jquery_countdown_date_formatter_jquery_countdown_default in jQuery Countdown 6

@file containes the cck formatter settings

File

jquery_countdown_date/jquery_countdown_date.formatter.inc, line 7
containes the cck formatter settings

Code

function theme_jquery_countdown_date_formatter_jquery_countdown_default(&$element) {
  $field = $element['#field_name'];
  $item = $element['#item'];
  $id = $element['#type_name'] . '_' . $element['#field_name'] . '_' . $item['#delta'];
  $widget_settings = jquery_countdown_date_get_field_settings($field, $element['#type_name']);
  $jquery_countdown_settings = $widget_settings['jquery_countdown'];
  $date = $item['value'];

  // sanitize block settings to a format the our jquery_countdown script is understanding ;)
  $jquery_countdown_options = array(
    $jquery_countdown_settings['until'] => date_format_date(date_make_date($date), 'custom', 'F d, Y g:i a', 'en_US'),
    'format' => implode('', $jquery_countdown_settings['format']),
  );
  $jquery_countdown_options = array_merge($jquery_countdown_settings, $jquery_countdown_options);
  return theme('jquery_countdown', $jquery_countdown_options, '', $id);
}