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 CiviReport (Moderator: Dave Greenberg) »
  • How to use, eg, Month and Year (rather than Complete Date) in CiviReport?
Pages: [1]

Author Topic: How to use, eg, Month and Year (rather than Complete Date) in CiviReport?  (Read 1276 times)

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
How to use, eg, Month and Year (rather than Complete Date) in CiviReport?
November 25, 2011, 01:10:15 am
I have found that if a column in a report displays a date that it does so according to the format specified in Global Settings / Date Formats / Complete Date, ie changing that to (for instance) "%E %b %Y" causes CiviReport to display all date values as (for example) "25 Nov 2011" (for today), but that means changing the Complete Date format universally for the whole CiviCRM installation (which may have undesirable consequences).

Is there a way to get CiviReport to use a different date format than Complete Date?  For instance in a specific date column in a specific report I might like the date to be formatted as per Month and Year - is there a way to do this?

Althernatively is there any other way to control the format that a specific report template displays dates?
Can anybody point me to some example code where something like this has been done before?

Thanks
Mark  :)

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: How to use, eg, Month and Year (rather than Complete Date) in CiviReport?
November 25, 2011, 01:00:25 pm

I dont think so. I think one approach might be to implement the alterRow function within the report and customize your date format there. Another approach might be to do the same in the smarty template. Just ideas, i've not tried either of these approaches :)

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

Mark Tompsett

  • I post frequently
  • ***
  • Posts: 143
  • Karma: 9
    • QualityTime Services Ltd
  • CiviCRM version: 4.3.4
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.30-cll
  • PHP version: 5.3.23
Re: How to use, eg, Month and Year (rather than Complete Date) in CiviReport?
November 26, 2011, 07:12:56 am
Thanks Lobo

I had thought of the alterRow function of which I have some experience, but I have no idea how to do that in the smarty template.  Could someone give me a clue, or point me to where something like that has been done before, please?

Thanks
Mark   :)

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: How to use, eg, Month and Year (rather than Complete Date) in CiviReport?
November 26, 2011, 08:43:45 am

hey mark:

There is a smarty plugin called crmDate and u can send in various date formatting options.

Search recursively for crmDate in the templates folder

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • How to use, eg, Month and Year (rather than Complete Date) in CiviReport?

This forum was archived on 2017-11-26.