Answers.Body: <p>Not sure what the problem is but you should be a able to debug the isConditionValid function in the generic form value comparison and that should tell you what the problem is?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-16T16:48:46.067Z
Answers.Text: Yes, looks like getComparisonValue is returning the date as a string in format 2022-09-15 here (https://lab.civicrm.org/extensions/civirules/-/blob/master/CRM/CivirulesConditions/Generic/ValueComparison.php#L93), but getFieldValue is returning a string in format 20220901162600. I'll open an issue on Gitlab.
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-16T18:22:51.470Z
Answers.Text: https://lab.civicrm.org/extensions/civirules/-/issues/186
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-16T07:15:03.860Z
Answers.LastActivityDate: 2022-09-16T07:15:03.860Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I'm trying to trigger a CiviRule when a contribution is created with a receive date earlier than today, using field value comparison, but I don't seem to be able to get this to work. According to <a href="https://civicrm.stackexchange.com/questions/11895/can-civirules-be-triggered-off-a-custom-field-of-type-date-for-eg-date-equals-no">this previous question</a>, I should be able to use yesterday, -1 day and similar, but none of these options are working for me. Has anyone else been able to get something along these lines to work?</p>
  <p>The field value comparison appears to be working:
  <a href="https://i.sstatic.net/mZ4kF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mZ4kF.png" alt="enter image description here" /></a>
  <a href="https://i.sstatic.net/a3xCD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/a3xCD.png" alt="enter image description here" /></a>
  but the rule is never triggered.</p>
  <p>I'm seeing a warning logged, but it doesn't seem directly related:
  [warning] Attributes passed to CRM_Core_Form::add() are not an array. Caller: CRM_CivirulesConditions_Form_ValueComparison::buildQuickForm
  Array
  (
  [civi.tag] =&gt; deprecated
  )</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-09-16T16:00:22.483Z
Comments.Text: Looks like that warning has already been fixed, just not released yet:
  https://lab.civicrm.org/extensions/civirules/-/commit/60b620a8e9f9460f1b58343d745e6bc6e8799c3c
  In any case, the same warning is logged with a condition that does work, so it's not related.
Comments.UserDisplayName: Lars SG
Tags: <civirules><fieldvaluecomparison>
Title: Trigger CiviRule based on contribution receive date with field value comparison relative to today
ThreadText: # Trigger CiviRule based on contribution receive date with field value comparison relative to today
  
  (Asked by: username_0 on 2022-09-15)
  
  I'm trying to trigger a CiviRule when a contribution is created with a receive date earlier than today, using field value comparison, but I don't seem to be able to get this to work. According to [this previous question](https://civicrm.stackexchange.com/questions/11895/can-civirules-be-triggered-off-a-custom-field-of-type-date-for-eg-date-equals-no), I should be able to use yesterday, -1 day and similar, but none of these options are working for me. Has anyone else been able to get something along these lines to work?
  
  The field value comparison appears to be working:
  [![enter image description here](https://i.sstatic.net/mZ4kF.png)](https://i.sstatic.net/mZ4kF.png)
  [![enter image description here](https://i.sstatic.net/a3xCD.png)](https://i.sstatic.net/a3xCD.png)
  but the rule is never triggered.
  
  I'm seeing a warning logged, but it doesn't seem directly related:
  [warning] Attributes passed to CRM\_Core\_Form::add() are not an array. Caller: CRM\_CivirulesConditions\_Form\_ValueComparison::buildQuickForm
  Array
  (
  [civi.tag] => deprecated
  )
  
  **Tags:** civirules, fieldvaluecomparison
  
  > **Comments:**
  > **username_0**: Looks like that warning has already been fixed, just not released yet: https://lab.civicrm.org/extensions/civirules/-/commit/60b620a8e9f9460f1b58343d745e6bc6e8799c3c In any case, the same warning is logged with a condition that does work, so it's not related.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-09-16. Score: 0
  
  Not sure what the problem is but you should be a able to debug the isConditionValid function in the generic form value comparison and that should tell you what the problem is?
  
  > **Comments:**
  > **username_0**: Yes, looks like getComparisonValue is returning the date as a string in format 2022-09-15 here (https://lab.civicrm.org/extensions/civirules/-/blob/master/CRM/CivirulesConditions/Generic/ValueComparison.php#L93), but getFieldValue is returning a string in format 20220901162600. I'll open an issue on Gitlab.  
  > **username_0**: https://lab.civicrm.org/extensions/civirules/-/issues/186  
  
  ---
  
  