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 CiviMember (Moderator: Deepak Srivastava) »
  • Receive_Date incorrect in template
Pages: [1]

Author Topic: Receive_Date incorrect in template  (Read 881 times)

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
Receive_Date incorrect in template
April 01, 2013, 07:17:10 pm
I haven't tested this for all cases, but when clicking the "Send Confirmation and Receipt?" checkbox on a membership, the template  "Memberships - Signup and Renewal Receipts (off-line)"  (id=35) seems to be receiving a date from civi that is not the expected format.

I'm in Civi 4.2 on Drupal 7.

The default template has {$receive_date|truncate:10:''|crmDate}  But for today's date (4/1/2013), what shows up in the email is "January 20th, 4".

If I modify the template to be just  {$receive_date} it comes out as "04/01/2013".  That's not pretty, but at least it's accurate.

Is there a better way to solve this, or should I stick to this solution?

nsjski

  • I’m new here
  • *
  • Posts: 22
  • Karma: 1
  • CiviCRM version: 4.3.5
  • CMS version: Drupal 7.28
  • MySQL version: 5.6.17
  • PHP version: 5.5.13
Re: Receive_Date incorrect in template
July 16, 2013, 08:43:56 am
I just filed a bug report for this same issue in civi 4.3.4  http://issues.civicrm.org/jira/browse/CRM-13063   

monish_deb

  • I’m new here
  • *
  • Posts: 5
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: 7.22
  • MySQL version: 5.5.31
  • PHP version: 5.3.10
Re: Receive_Date incorrect in template
July 22, 2013, 12:39:25 am
Although I have fixed the issue but still want to share the reason behind this bug. The issue was occurring due to passing raw date format (= 07/17/2013) where crmDate always accepts date in mysql date format (=  20130717000000). On the otherhand there is another date modifier called date_format which can accepts any date format including the one mentioned above but we always use crmDate to respect localization, nativity, full Date Format etc. As you can see my PR for one issued in JIRA, I have just passed the mysql date format to crmDate for proper display.

Cheers,
Monish D.
« Last Edit: July 22, 2013, 12:41:12 am by monish_deb »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Receive_Date incorrect in template

This forum was archived on 2017-11-26.