You are here

function _scheduler_date_format_in_strftime_syntax in Scheduler 5

1 call to _scheduler_date_format_in_strftime_syntax()
scheduler_form_alter in ./scheduler.module
Implementation of hook_form_alter().

File

./scheduler.module, line 200

Code

function _scheduler_date_format_in_strftime_syntax() {
  $date_format = variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT);
  $date_entities = array(
    'd',
    'H',
    'h',
    'm',
    'i',
    'a',
    'A',
    's',
    'y',
    'Y',
  );
  $strftime_replacements = array(
    '%d',
    '%H',
    '%I',
    '%m',
    '%M',
    '%p',
    '%p',
    '%S',
    '%y',
    '%Y',
  );
  return str_replace($date_entities, $strftime_replacements, $date_format);
}