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) »
  • Adding day of the week to a date
Pages: [1]

Author Topic: Adding day of the week to a date  (Read 669 times)

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Adding day of the week to a date
September 27, 2010, 05:44:38 am
Hi there,

In the event listing on my site the date currently reads 'When September 23rd, 2010 7:00 PM   through  December 2nd, 2010 9:00 PM '
I am trying to change this to 'When Thursday September 23rd, 2010 7:00 PM   to  Thursday December 2nd, 2010 9:00 PM ' (required changes in green).

I am looking at this file to try and make the changes: /templates/CRM/Event/Page/EventInfo.tpl
I can see where the 'through' is and I have changed this to 'to', but I'm struggling with adding the day of the week to the date format. In the file it currently looks like this: <abbr class="dtstart" title="{$event.event_start_date|crmDate}">
                 {$event.event_start_date|crmDate}</abbr>
             {if $event.event_end_date}
             &nbsp; {ts}to{/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>   

Firstly, am I looking in the right place? And secondly can someone please tell me (in simple English - I'm new to this  :)) how to add the day of the week in to the above code, or where to do it if I'm barking up the wrong tree.

Thanks a lot!

Katy
Do what you love, it's your gift to the universe

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: Adding day of the week to a date
September 27, 2010, 06:29:15 am
can u try:

Code: [Select]
{$event.event_start_date|crmDate:"%A %B, %Y %l:%M %P"}

check:

http://php.net/manual/en/function.strftime.php

if u want other date/time related format strings

lobo

p.s> since u r in the UK, u might be interested in our user or developer training:

http://civicrm.org/civicrm/event/info?reset=1&id=65
http://civicrm.org/civicrm/event/info?reset=1&id=66
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Katy J

  • I post occasionally
  • **
  • Posts: 50
  • Karma: 4
    • Third Sector Design
Re: Adding day of the week to a date
September 28, 2010, 05:05:00 am
Thanks Lobo  :D
I will be at the training, I am a good friend of/work with Michael at Third Sector Design!
See you on Thursday?
Do what you love, it's your gift to the universe

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Adding day of the week to a date

This forum was archived on 2017-11-26.