Announcement

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

  • AdvancedCriteria DateTime field Equals "Today" expected behaviour?

    What is the expected behaviour of a Criteria of a DateTime field where the operator is set to Equals and the Value set to "Today"?

    Should it match every DateTime value for the entire day?

    So a Filter/Criteria such as this where createdOn is a DateTime field:
    Code:
    "criteria":[
        {
            "fieldName":"createdOn", 
            "operator":"equals", 
            "value":{
                "_constructor":"RelativeDate", 
                "value":"$today"
            }
        }
    ]

  • #2
    It should produce criteria that have the same result as $today for a logical date field - so, yes, it should cover the whole day.

    We're looking at the best way to address it and will update here shortly

    Comment


    • #3
      Some observations you are probably already taking into consideration w/r to preset options and operators for DateTime field criteria ala RelativeDateItem:

      - EQUALS and NOT EQUALS for the preset options (Today, Tomorrow...) logically equate to a BETWEEN INCLUSIVE and NOT BETWEEN INCLUSIVE respectively using the start of day time and end of day times.

      - LESS THAN would use start of day time

      - LESS THAN OR EQUAL TO would use end of day time

      - GREATER THAN would use end of day time

      - GREATER THAN OR EQUAL TO would use start of day time

      - BETWEEN INCLUSIVE would use start of day time for 1st value and end of day time for 2nd value (if they are preset options)

      There are probably other stuff you are considering as well but those are the cases I have in my application as those are the operators I expose for DateTime fields.

      Obviously if a specific value has been used either by the input box or the picker, then no adjustments are required.
      Last edited by stonebranch1; 11th Jun 2014, 04:58.

      Comment


      • #4
        We've just added this support for all appropriate operators for any relativeDate selection - you can test it out in tomorrow's build.

        Note that serializing the criteria isn't sufficient to see what will run against your database, because relative strings in criteria in DSRequests are bulk replaced at the last minute - look in the dev console instead.

        Comment


        • #5
          Looks great. Thanks!

          Comment

          Working...
          X