You are here

function date_popup_format_to_popup_time in Date 7

Same name and namespace in other branches
  1. 5.2 date_popup/date_popup.module \date_popup_format_to_popup_time()
  2. 6.2 date_popup/date_popup.module \date_popup_format_to_popup_time()
  3. 6 date_popup/date_popup.module \date_popup_format_to_popup_time()
  4. 7.3 date_popup/date_popup.module \date_popup_format_to_popup_time()
  5. 7.2 date_popup/date_popup.module \date_popup_format_to_popup_time()

Recreate a date format string so it has the values popup expects.

Parameters

string $format: a normal date format string, like Y-m-d

Return value

string a format string in popup format, like YMD-

1 call to date_popup_format_to_popup_time()
date_popup_time_format in date_popup/date_popup.module

File

date_popup/date_popup.module, line 487
A module to enable jquery calendar and time entry popups. Requires the Date API.

Code

function date_popup_format_to_popup_time($format) {
  if (empty($format)) {
    $format = 'H:i';
  }
  $format = strtr($format, timepicker_format_replacements());
  $format = str_replace(array(
    ' ',
    '/',
    '-',
    ' .',
    ',',
    'F',
    'M',
    'l',
    'z',
    'w',
    'W',
    'd',
    'j',
    'm',
    'n',
    'y',
    'Y',
  ), '', $format);
  return $format;
}