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
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
Comment