$config = CRM_Core_Config::singleton();
$dateFormat = $config->dateformatTime;
}
-
+ if (is_int($dateString)) {
+ return CRM_Utils_Date::customFormatTs($dateString, $dateFormat);
+ }
return CRM_Utils_Date::customFormat($dateString, $dateFormat);
}
return '';
$hour24 = (int) substr($dateString, 11, 2);
$minute = (int) substr($dateString, 14, 2);
- $second = (int) substr($dateString, 16, 2);
+ $second = (int) substr($dateString, 17, 2);
}
else {
$year = (int) substr($dateString, 0, 4);
'%A' => $type,
'%Y' => $year,
'%s' => str_pad($second, 2, 0, STR_PAD_LEFT),
+ '%S' => str_pad($second, 2, 0, STR_PAD_LEFT),
];
return strtr($format, $date);
UID:CIVICRMACTIVITY{$activity->id}
SUMMARY:{$activity->subject|crmICalText}
CALSCALE:GREGORIAN
-DTSTAMP;TZID={$timezone}:{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'|crmICalDate}
+DTSTAMP;TZID={$timezone}:{$smarty.now|crmDate:'%Y-%m-%d %H:%M:%S'|crmICalDate}
DTSTART;TZID={$timezone}:{$activity->activity_date_time|crmICalDate}
DURATION:PT{$activity->duration}M
{if $activity->location}
{/if}
{else}
<div class="label">{$form.start_date.label}</div>
- <div class="content">{$start_date_display|date_format}</div>
+ <div class="content">{$start_date_display|crmDate:'%b %e, %Y'}</div>
{/if}
<div class="clear"></div>
</div>
<div id='help'>
{* Lifetime memberships have no end-date so current_membership array key exists but is NULL *}
{if $row.current_membership}
- {if $row.current_membership|date_format:"%Y%m%d" LT $smarty.now|date_format:"%Y%m%d"}
+ {if $row.current_membership|crmDate:"%Y%m%d" LT $smarty.now|crmDate:"%Y%m%d"}
{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expired on %1.{/ts}<br />
{else}
{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expires on %1.{/ts}<br />
{* Check if there is an existing membership of this type (current_membership NOT empty) and if the end-date is prior to today. *}
{if array_key_exists( 'current_membership', $row ) AND $context EQ "makeContribution" }
{if $row.current_membership}
- {if $row.current_membership|date_format:"%Y%m%d" LT $smarty.now|date_format:"%Y%m%d"}
+ {if $row.current_membership|crmDate:"%Y%m%d" LT $smarty.now|crmDate:"%Y%m%d"}
<br /><em>{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expired on %1.{/ts}</em>
{else}
<br /><em>{ts 1=$row.current_membership|crmDate 2=$row.name}Your <strong>%2</strong> membership expires on %1.{/ts}</em>
DTSTAMP;TZID={$timezone}:{$event.start_date|crmICalDate}
DTSTART;TZID={$timezone}:{$event.start_date|crmICalDate}
{else}
-DTSTAMP;TZID={$timezone}:{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'|crmICalDate}
+DTSTAMP;TZID={$timezone}:{$smarty.now|crmDate:'%Y-%m-%d %H:%M:%S'|crmICalDate}
{/if}
{if $event.end_date}
DTEND;TZID={$timezone}:{$event.end_date|crmICalDate}
{/if}
{if $event.start_date}{ts}When{/ts}: {$event.start_date|crmDate}{if $event.end_date} {ts}through{/ts} {strip}
{* Only show end time if end date = start date *}
- {if $event.end_date|date_format:"%Y%m%d" == $event.start_date|date_format:"%Y%m%d"}
- {$event.end_date|date_format:"%I:%M %p"}
+ {if $event.end_date|crmDate:"%Y%m%d" == $event.start_date|crmDate:"%Y%m%d"}
+ {$event.end_date|crmDate:"%I:%M %p"}
{else}
{$event.end_date|crmDate}
{/if}{/strip}
{if $event.event_end_date}
{ts}through{/ts}
{* Only show end time if end date = start date *}
- {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
+ {if $event.event_end_date|crmDate:"%Y%m%d" == $event.event_start_date|crmDate:"%Y%m%d"}
{$event.event_end_date|crmDate:0:1}
{else}
{$event.event_end_date|crmDate}
<td class="right nowrap crm-participant-participant_fee_amount">{$row.participant_fee_amount|crmMoney:$row.participant_fee_currency}</td>
<td class="crm-participant-participant_register_date">{$row.participant_register_date|truncate:10:''|crmDate}</td>
<td class="crm-participant-event_start_date">{$row.event_start_date|truncate:10:''|crmDate}
- {if $row.event_end_date && $row.event_end_date|date_format:"%Y%m%d" NEQ $row.event_start_date|date_format:"%Y%m%d"}
+ {if $row.event_end_date && $row.event_end_date|crmDate:"%Y%m%d" NEQ $row.event_start_date|crmDate:"%Y%m%d"}
<br/>- {$row.event_end_date|truncate:10:''|crmDate}
{/if}
</td>
{/if}
<td class="crm-event-print-event_participant_fee_amount">{$row.participant_fee_amount|crmMoney}</td>
<td class="crm-event-print-event_date">{$row.event_start_date|truncate:10:''|crmDate}
- {if $row.event_end_date && $row.event_end_date|date_format:"%Y%m%d" NEQ $row.event_start_date|date_format:"%Y%m%d"}
+ {if $row.event_end_date && $row.event_end_date|crmDate:"%Y%m%d" NEQ $row.event_start_date|crmDate:"%Y%m%d"}
<br/>- {$row.event_end_date|truncate:10:''|crmDate}
{/if}
</td>
{if $event.event_end_date}
{ts}through{/ts}
{* Only show end time if end date = start date *}
- {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
+ {if $event.event_end_date|crmDate:"%Y%m%d" == $event.event_start_date|crmDate:"%Y%m%d"}
{$event.event_end_date|crmDate:0:1}
{else}
{$event.event_end_date|crmDate}
<td class="nowrap" data-order="{$event.start_date|crmDate:'%Y-%m-%d'}">
{if $event.start_date}{$event.start_date|crmDate}{if $event.end_date}<br /><em>{ts}through{/ts}</em><br />{strip}
{* Only show end time if end date = start date *}
- {if $event.end_date|date_format:"%Y%m%d" == $event.start_date|date_format:"%Y%m%d"}
+ {if $event.end_date|crmDate:"%Y%m%d" == $event.start_date|crmDate:"%Y%m%d"}
{$event.end_date|crmDate:0:1}
{else}
{$event.end_date|crmDate}
{if $row.event_end_date}
-
{* Only show end time if end date = start date *}
- {if $row.event_end_date|date_format:"%Y%m%d" == $row.event_start_date|date_format:"%Y%m%d"}
+ {if $row.event_end_date|crmDate:"%Y%m%d" == $row.event_start_date|crmDate:"%Y%m%d"}
{$row.event_end_date|crmDate:0:1}
{else}
{$row.event_end_date|crmDate}
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}// http://civicrm.org/licensing
-// <script> Generated {$smarty.now|date_format:'%d %b %Y %H:%M:%S'}
+// <script> Generated {$smarty.now|crmDate:'%d %b %Y %H:%M:%S'}
{* This file should only contain strings and settings which rarely change *}
(function($) {ldelim}
// Config settings
</li>
{$navigation}
</ul>
-{/strip}{/capture}// <script> Generated {$smarty.now|date_format:'%d %b %Y %H:%M:%S'}
+{/strip}{/capture}// <script> Generated {$smarty.now|crmDate:'%d %b %Y %H:%M:%S'}
{literal}
(function($) {
var menuMarkup = {/literal}{$menuMarkup|@json_encode}{literal};