Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    AdvancedCriteria, RelativeDate, "N hours ago"

    Hello,

    We are having a problem when specifying filters at the hour and minute level for type="datetime" fields.

    I have attached a screenshot of the filter builder where we specify the following criteria.

    "Created" "greater than or equal to" "N hours ago" "47" -> (2014-06-23 09:54:00 -0400)

    The following is the AdvancedCriteria.

    Code:
    {
        "_constructor":"AdvancedCriteria", 
        "operator":"and", 
        "criteria":[
            {
                "fieldName":"createdOn", 
                "operator":"greaterOrEqual", 
                "value":{
                    "_constructor":"RelativeDate", 
                    "value":"-47h[-0MN]"
                }
            }
        ]
    }
    The following is the DSRequest criteria.

    Code:
    data:{
        operator:"and", 
        criteria:[
            {
                fieldName:"createdOn", 
                operator:"greaterOrEqual", 
                value:"2014-06-23T04:00:00.000"
            }
        ]
    }
    We were expecting the criteria to be exactly 47 hours ago, instead the criteria is sent as "2014-06-23T04:00:00.000".

    SmartClient Version: v9.1p_2014-06-17/Pro Deployment (built 2014-06-17)

    FF ESR 24.6.0

    Thanks
    Attached Files
    Last edited by stonebranch2; 25 Jun 2014, 05:58. Reason: Fixed AdvancedCriteria snippet to use the hour example, instead of minutes, however both are problematic.

    #2
    This looks like a problem with the newer build.

    A RelativeDate of "-1h" in SmartClient Version: v9.1p_2014-06-04/Pro Deployment (built 2014-06-04), produced the following DSRequest criteria.

    Code:
        data:{
            fieldName:"updatedOn", 
            operator:"greaterOrEqual", 
            value:"2014-06-24T19:29:27.429"
        },
    A RelativeDate of "-1h" in SmartClient Version: v9.1p_2014-06-17/Pro Deployment (built 2014-06-17), produced the following DSRequest criteria.

    Code:
        data:{
            fieldName:"updatedOn", 
            operator:"greaterOrEqual", 
            value:"2014-06-24T04:00:00.000"
        },

    Comment


      #3
      Thanks for the notification - we'll take a look and let you know what we find

      Regards
      Isomorphic Software

      Comment


        #4
        We're not clear on how you were able to generate the criteria you show - can you let us know? Was it with a FilterBuilder? If so, is the field a "datetime", and what operator/value did you use?

        That said, while we weren't able to generate the criteria you showed, we *did* find that a FilterBuilder showing a clause like "datetime_field equals '-1h'" would have generated a "betweenInclusive" criteria, spanning the day it represented, and not an "equals" criteria of any kind.

        This was a recent enhancement but have should been applicable only to pre-defined relativeDates, like "$today".

        Please retest with a build dated June 28 or later and, if you still see issues, provide the details we asked for at the top of this post.

        Comment


          #5
          Sorry, we'd missed the screenshot attached to your first post - from that, we can see the issue, and a further change has been made to deal with it. Please retest with a build dated June 28 or later.

          Comment

          Working...
          X