You are here

function _signup_get_date_format in Signup 5.2

Helper function to get the date format string to use based on settings.

Sadly, there's nothing in core to provide this info based on the core format settings (small, medium, large), so this code is lifted from format_date() from includes/common.inc in core. This is necessary for the event module 5.x-1.* backend, since event uses its own proprietary _event_date() function instead of format_date().

Return value

The date format string to used based on the current value of the 'signup_date_format' setting and the core format strings.

1 call to _signup_get_date_format()
_signup_event_format_date in includes/event.5x-1.inc

File

includes/event.5x-1.inc, line 99
Code required to support version 5.x-1.* of the event module.

Code

function _signup_get_date_format() {
  $format = '';
  switch (variable_get('signup_date_format', 'small')) {
    case 'small':
      $format = variable_get('date_format_short', 'm/d/Y - H:i');
      break;
    case 'large':
      $format = variable_get('date_format_long', 'l, F j, Y - H:i');
      break;
    case 'custom':

      // No change to format
      break;
    case 'medium':
    default:
      $format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
  }
  return $format;
}