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) »
  • Can start date be earlier than 2006?
Pages: [1]

Author Topic: Can start date be earlier than 2006?  (Read 2223 times)

Colin Sagan

  • Guest
Can start date be earlier than 2006?
May 28, 2007, 10:25:12 pm
I am moving the registration of a conference that has been going on for about 10 years over to CiviEvent. I would love to be able to put the historical data in as well. Is there any way to change the dates that populate the drop down menu for the event start date in an intelligent way? Currently it is 2006.

Thanks!

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: Can start date be earlier than 2006?
May 29, 2007, 01:20:08 am

Colin:

There is nothing in the data model that prevents you from storing past data. however the web interface  probably does not allow you to create events in the past. to tweak the interface your best bet is to do the following:

1. read http://civicrm.org/architecture/ and understand the civicrm code and layout structure

2. find the relevant php and tpl files and make the change :)

we are happy to assist you with the above on IRC :)

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

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Can start date be earlier than 2006?
May 29, 2007, 01:29:43 am

Hi Colin,

All you need to do for reconfiguring your start date to 10 years back is
go to line no 140 in CRM/Event/Form/ManageEvent/EventInfo.php
and replace
       CRM_Core_SelectValues::date('datetime'),
by
        CRM_Core_SelectValues::date('custom', 10, 3,'MdY,h:iA'),

Hope this helps.

Thanks
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Colin Sagan

  • Guest
Re: Can start date be earlier than 2006?
May 29, 2007, 02:09:41 pm
Lobo and Yashodha,
Thanks for the tips, it works perfectly.

Big thanks for help with the specific code!

Colin

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Can start date be earlier than 2006?
April 17, 2009, 04:54:11 am
I realize this thread is quite old and the code presented was for an older version of CiviCRM.

It, however, doesn't work for CiviCRM 2.1. I tried it on line 175 of CRM/Event/Form/ManageEvent/EventInfo.php but the date fields now don't appear on the web page.

Can someone provide the correct syntax for 2.1?

Thanks.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Can start date be earlier than 2006?
April 17, 2009, 05:46:11 am
hi

Code: [Select]
        $StartOffset = 20;
        $endOffset = 10;
        $dateParts = implode( CRM_Core_DAO::VALUE_SEPARATOR, array( 'Y', 'M', 'd', 'h', 'i', 'A' ) );
        $this->add( 'date', 'start_date',
                    ts('Start Date'),
                    CRM_Core_SelectValues::date('custom', $StartOffset, $endOffset, $dateParts ) );

hope this syntax help you

kiran
       
You Are Designed To Choose... Defined By Choice.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Can start date be earlier than 2006?
April 17, 2009, 06:12:06 am
Perfect. Thank you very much.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Can start date be earlier than 2006?

This forum was archived on 2017-11-26.