You are here

function date_popup_format_to_popup in Date 7.2

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

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-, for the earlier 'calendar' version, or m/d/Y for the later 'datepicker' version.

1 call to date_popup_format_to_popup()
date_popup_process_date_part in date_popup/date_popup.module
Process the date portion of the element.

File

date_popup/date_popup.module, line 718
A module to enable jQuery calendar and time entry popups.

Code

function date_popup_format_to_popup($format) {
  if (empty($format)) {
    $format = 'Y-m-d';
  }
  $replace = date_popup_datepicker_format_replacements();
  return strtr($format, $replace);
}