Announcement

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

    RelativeDate FilterBuilder/AdvancedCriteria simulating Today?

    If I have a FilterBuilder or more appropriately, an AdvancedCriteria that contains Relative Dates and/or DateTimes like "Current day of last week" or "N days ago - 5" or "Today" but I would like to have that criteria evaluated/resolved not on the actual date as of now but to specify a date for "now/Today" from which the criteria would be resolved?

    So for example if I evaluated the criteria right now it would all be resolved based on Aug 5th, 2014 at the current time, but I want to have the criteria resolved as if "now" was say Aug 1st, 2014.

    Any way to accomplish this?

    Thanks

    #2
    The utility method DateUtil.getAbsoluteDate that allows conversion of a RelativeDate with a base date provided.

    Probably an additional optional parameter to DataSource.convertRelativeDates() would be more convenient for you, we'll see if that's easy to add.

    Comment


      #3
      Thank You Kindly, much appreciated.

      Comment


        #4
        We've exposed a baseDate parameter to DataSource.convertRelativeDates().

        Note that RelativeDateItems also support setBaseDate(), which is used by calls to item.getAbsoluteDate(), and the classMethod RelativeDateItem.getAbsoluteDate(relativeDate, baseDate).

        Comment


          #5
          Excellent, much appreciated. Thank you!

          Comment

          Working...
          X