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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How to make date field default to today's date if not changed?
Pages: [1]

Author Topic: How to make date field default to today's date if not changed?  (Read 1600 times)

jeanne.rewa

  • Guest
How to make date field default to today's date if not changed?
September 17, 2008, 07:38:53 am
I'm trying to create a custom field for a date.  I would like it to work the way it does with CiviContribute's Receive Date or CiviMember's Join Date, where unless you edit it when you're filling in the form, it defaults to today's date.  Can anyone tell me how to do that?

Thanks!!
Jeanne

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: How to make date field default to today's date if not changed?
September 17, 2008, 11:43:24 am
If you are on CiviCRM v2.1, using buildForm() hook, you will be able to set defaults to custom data.

HTH

kurund
Found this reply helpful? Support CiviCRM

jeanne.rewa

  • Guest
Re: How to make date field default to today's date if not changed?
September 22, 2008, 10:40:02 am
I'm using version 1.7.  What do I do there?

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 make date field default to today's date if not changed?
September 22, 2008, 11:39:17 am

You will need to hack the code directly to make this happen. You can catch us on IRC

http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true

You should also read http://civicrm.org/architecture/ to get an idea of the structure etc

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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • How to make date field default to today's date if not changed?

This forum was archived on 2017-11-26.