CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event Reg Email Template: start time error
Pages: [1]

Author Topic: Event Reg Email Template: start time error  (Read 544 times)

bwold

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
Event Reg Email Template: start time error
September 11, 2012, 09:42:57 am
Our event registration templates are dropping the start time, so instead of showing "September 12, 2012 3 PM - 8 PM," attendees are getting "September 12, 2012- 8PM." Yikes.

I've found the relevant email template, and it looks like the code below is the section that produces the date and time. However, I'm really green on templates. Can anyone advise?

Thanks in advance.

Code: [Select]
{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Event Reg Email Template: start time error
September 11, 2012, 10:45:20 am

is this in the email or on the info / registration pages?

if the latter, can you please reproduce this on the demo server

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bwold

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
Re: Event Reg Email Template: start time error
September 11, 2012, 11:11:05 am
Apologies for the confusion. It's in the email template:  CiviCRM » Administer CiviCRM » Message Templates, System Workflow Templates, Events - Registration Confirmation and Receipt (on-line). Occurs on about line 49 in the text version.

For now, I've modified the template to only show the date:
Code: [Select]
{$event.event_start_date|crmDate}

Since currently all our events are one day meetings, this works... but I'd like to at least show the start and end times.

Thanks for the assistance.

bwold

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
Re: Event Reg Template: start time error
October 04, 2012, 11:08:27 am
Folks, I'm back. Turns out the same problem exists in the registration template as well. So, per Lobo's suggestion, I tested this on the demo server, and it works correctly there:

My client's event: November 7, 2012   through   11:30 PM
(Should say November 7, 2012 6 PM through   11:30 PM

After some digging, it looks like the template for this (in Joomla) is ./administrator/components/com_civicrm/civicrm/templates/CRM/event/page/EventInfo.tpl

Code: [Select]
<div class="crm-section event_date_time-section">
<div class="label"><label>{ts}When{/ts}</label></div>
<div class="content">
<abbr class="dtstart" title="{$event.event_start_date|crmDate}">
{$event.event_start_date|crmDate}</abbr>
{if $event.event_end_date}
&nbsp; {ts}through{/ts} &nbsp;
{* 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"}
<abbr class="dtend" title="{$event.event_end_date|crmDate:0:1}">
{$event.event_end_date|crmDate:0:1}
</abbr>
{else}
<abbr class="dtend" title="{$event.event_end_date|crmDate}">
{$event.event_end_date|crmDate}
</abbr>
{/if}
{/if}
</div>

But... how to fix this so it displays the start time?

As always, thanks in advance.

bwold

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
Re: Event Reg Email Template: start time error
October 04, 2012, 11:41:30 am
Followup: I found a piece of shoe leather, bit down hard on it, and changed line 48 in the template to
Code: [Select]
{$event.event_start_date|crmDate}, {$event.event_start_date|crmDate:0:1}</abbr>

I'm now seeing both date and time. However, since I can't find much documentation for the crmDate and crmDate:0:1 functions, I don't know what collateral damage may have occurred.

Maybe I'm okay here, but if anyone has further info, I'd be appreciative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event Reg Email Template: start time error

This forum was archived on 2017-11-26.