Announcement

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

    Using "matches other field" filter with 2 dates

    Hi we are using SmartGWT 4.0. In our application we use a FilterBuilder to filter a grid. One option in the FilterBuilder is "matches other field", this works for String fields but doesn't seem to work for datetimes.
    I have a record which contains 2 date times which are the same, I have even extracted the data as Dates and they match.

    Date endDate = designElementsInstance.preparationsGrid.getSelectedRecord().getAttributeAsDate("END_DATE");
    Date releaseTime = designElementsInstance.preparationsGrid.getSelectedRecord().getAttributeAsDate("RELEASE_TIME");
    if (endDate.equals(releaseTime)) {
    SC.logWarn("They are equal"); // this is printed
    }
    else {
    SC.logWarn("They are not equal " + endDate.toLocaleString() + " - " + releaseTime.toLocaleString());
    }

    This is the output from the logging

    09:43:40.303:TMR6:INFO: DataSource:disseminationPrepDS:Called convertRelativeDates from sendDSRequest - data is

    {
    "_constructor":"AdvancedCriteria",
    "operator":"and",
    "criteria":[
    {
    "operator":"equalsField",
    "fieldName":"END_DATE",
    "value":"RELEASE_TIME"
    },
    {
    "fieldName":"datasetId",
    "operator":"equals",
    "value":"106"
    }
    ]
    }

    No rows are returned from the query.

    The fields are defined with the same data type.

    <field name="END_DATE" type="datetime" title="Prepared at"/>
    <field name="RELEASE_TIME" type="datetime" />

    Am I missing something?

    Thanks

    Emmet
    Last edited by emmetmryan; 1 Sep 2016, 02:21.

    #2
    We can't tell if there's a usage issue or framework issue here, but your version is too old to look into, and you only provided a partial version with no date stamp (see FAQ) so we can't even tell if you are up to date on patches.

    The first thing to do is to update to a current version of SmartGWT.

    Comment

    Working...
    X