if (empty($date['format'])) {
if ($context == 'Input') {
$date['format'] = Civi::settings()->get('dateInputFormat');
- $date['php_datetime_format'] = self::datePluginToPHPFormats(Civi::settings()->get('dateInputFormat'));
}
else {
$date['format'] = 'M d';
}
}
}
+
+ $date['smarty_view_format'] = CRM_Utils_Date::getDateFieldViewFormat($date['format']);
if (!isset($date['time'])) {
$date['time'] = FALSE;
}
* @return array
*/
public static function contributionTokens() {
- return array(
+ return array_merge(array(
'{contribution.contribution_id}' => ts('Contribution ID'),
'{contribution.total_amount}' => ts('Total Amount'),
'{contribution.fee_amount}' => ts('Fee Amount'),
//'{contribution.address_id}' => ts('Address ID'),
'{contribution.check_number}' => ts('Check Number'),
'{contribution.campaign}' => ts('Contribution Campaign'),
- );
+ ), CRM_Utils_Token::getCustomFieldTokens('contribution', TRUE));
}
/**
return $dateInputFormats;
}
- /**
- * Map date plugin and actual format that is used by PHP.
- *
- * @return array
- */
- public static function datePluginToPHPFormats() {
- $dateInputFormats = array(
- "mm/dd/yy" => 'm/d/Y',
- "dd/mm/yy" => 'd/m/Y',
- "yy-mm-dd" => 'Y-m-d',
- "dd-mm-yy" => 'd-m-Y',
- "dd.mm.yy" => 'd.m.Y',
- "M d, yy" => 'M j, Y',
- "d M yy" => 'j M Y',
- "MM d, yy" => 'F j, Y',
- "d MM yy" => 'j F Y',
- "DD, d MM yy" => 'l, j F Y',
- "mm/dd" => 'm/d',
- "dd-mm" => 'd-m',
- "yy-mm" => 'Y-m',
- "M yy" => 'M Y',
- "yy" => 'Y',
- );
- return $dateInputFormats;
- }
-
/**
* Time formats.
*