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 (Moderator: Dave Greenberg) »
  • Custom date as YYYY does not allow searches
Pages: [1]

Author Topic: Custom date as YYYY does not allow searches  (Read 966 times)

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Custom date as YYYY does not allow searches
March 08, 2010, 10:43:36 am
If a custom date is set at the format YYYY, advanced searches automatically default to today.  In other words, if I do a search on a custom date field that is set as YYYY, I can select 2009 (and of course the month/day b/c the pop-up requires a day), and the search uses "March 8, 2010, time..."  This is true for "search by ranges" as well, in which case both searched dates are today, about a minute apart.

I have confirmed this on the demo.drupal site.  Do a search for a contact using the "Marriage Date" field, which I have set to YYYY.  It will default to the day you select the search, not the day you actually selected.

An additional problem I am having, though I am not sure it is related and I have not confirmed this on the site, is that when a contact updates a profile with this custom date in it, the date defaults to the day they updated the profile, even if they did not enter a date.  If they had a date in the field, it updates it automatically.  The settings on the field do not require a default date.

So, something appears to be very wrong with the YYYY default setting.  Any ideas?  I kind of need that field!  This was not a problem on 2.2.8, and I don't recall it on 3.0.x, but I am seeing it on 3.1.1 as well as my test version of 3.1.3.

Thanks,
Maria

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Custom date as YYYY does not allow searches
March 10, 2010, 11:18:53 am
Upon further investigation, mm/yyyy seems to work fine.  It is only yyyy that is not 'taking'.  Any ideas as to why this is the case?

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Custom date as YYYY does not allow searches
May 18, 2010, 08:22:23 pm
I've run into some issue with this as well. All the date fields are stored as a full date type value (yyyy-mm-dd hh:mm) -- which is fine, except the interface needs to handle the different display formats in different ways. With the current structure, the yyyy format is pretty much unusable.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Custom date as YYYY does not allow searches

This forum was archived on 2017-11-26.