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 Profiles (Moderator: Dave Greenberg) »
  • Custom Date Field YYYY format (year only) does not save values to db
Pages: [1]

Author Topic: Custom Date Field YYYY format (year only) does not save values to db  (Read 394 times)

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Custom Date Field YYYY format (year only) does not save values to db
September 22, 2014, 05:47:47 pm
There is a bug on this,  CRM-14220.  It's marked as trivial. 

The bug was reported back in Feb.  It looks like it is targeted for 4.6.  I understand there may not be very many people using that format but it seems like on releases until it is fixed, it should at least give an error so one knows it doesn't work at all.  I believe it worked at one point.  I have a couple fields on profiles that are used by our constituents with just yyyy, and, of course, after I send out a bulk email getting people to update info via the profile I find out all the year data anyone entered never made it into the db.  Shame on me for not fully testing something that I think use to work and for not noticing during some testing but we've used the profile before.

I realize the work to fix this is probably volunteer and I am not bemoaning the fact that it hasn't been fixed yet, just that a known data issue doesn't even raise an error.

I also realize that there may be questions on just how it the date should be actually stored in the db and pulled back.  It looks like based on forum post back through many years, people have complained about using YYYY and then getting back day and month info as well.  My 2 cents is store it in the database as YYYY-01-01 00:00.  That way it looks like it was deliberate if you actually look at the db.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Custom Date Field YYYY format (year only) does not save values to db
September 22, 2014, 06:01:42 pm
Its actually quite simple to bump the fix version for an issue. Just supply a patch or PR that fixes the issue, and the core team will review it and merge it into the next release.
We're pretty much a do-ocracy around here :)
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Custom Date Field YYYY format (year only) does not save values to db

This forum was archived on 2017-11-26.