Hi Isomorphic,
We have seen now that in the dsRequests dateTime has value formatted to display miliseconds.
In our project we provide search mask with dateTime fields from and to.
For this purpose we use com.smartgwt.client.widgets.form.fields.RelativeDateItem which is set to type FieldType.DATETIME.
This is how we construct our items:
There are 3 possibilities to set the value to the item
For the case 2 and 3 we got slightly different criteria:
When the to item has RelativeDateRangePosition.END, shouldn't be for 2nd and 3rd case date value generated with 999 miliseconds?
Attached modified showcase.
Tested on Chrome and build SmartClient Version: v10.0p_2016-06-15/LGPL Development Only (built 2016-06-15)
We have seen now that in the dsRequests dateTime has value formatted to display miliseconds.
In our project we provide search mask with dateTime fields from and to.
For this purpose we use com.smartgwt.client.widgets.form.fields.RelativeDateItem which is set to type FieldType.DATETIME.
This is how we construct our items:
Code:
final RelativeDateItem fromRelativeDateItem = new RelativeDateItem("independenceFrom"); fromRelativeDateItem.setOperator(OperatorId.GREATER_OR_EQUAL); fromRelativeDateItem.setRangePosition(RelativeDateRangePosition.START); fromRelativeDateItem.setType(FieldType.DATETIME.getValue()); final RelativeDateItem toRelativeDateItem = new RelativeDateItem("independenceTo"); toRelativeDateItem.setOperator(OperatorId.LESS_OR_EQUAL); toRelativeDateItem.setRangePosition(RelativeDateRangePosition.END); toRelativeDateItem.setType(FieldType.DATETIME.getValue());
- select relative value (e.g. yesterday)
- select date from the calendar
- type in the date
Code:
{ dataSource: "worldDS", operationType: "fetch", data: { operator: "and", criteria: [{ operator: "and", criteria: [{ fieldName: "independence", operator: "greaterOrEqual", value: "2016-07-19T22:00:00.000" }, { fieldName: "independence", operator: "lessOrEqual", value: "2016-07-22T21:59:59.999" }] }, { operator: "greaterOrEqual", value: "2016-07-19T22:00:00.000", fieldName: "independenceFrom" }, { operator: "lessOrEqual", value: "2016-07-22T21:59:59.999", fieldName: "independenceTo" }] } }
Code:
{ dataSource: "worldDS", operationType: "fetch", data: { operator: "and", criteria: [{ operator: "and", criteria: [{ fieldName: "independence", operator: "greaterOrEqual", value: "2016-07-19T22:00:00.000" }, { fieldName: "independence", operator: "lessOrEqual", value: "2016-07-22T21:59:00.000" }] }, { operator: "greaterOrEqual", value: "2016-07-19T22:00:00.000", fieldName: "independenceFrom" }, { operator: "lessOrEqual", value: "2016-07-22T21:59:00.000", fieldName: "independenceTo" }] } }
Attached modified showcase.
Tested on Chrome and build SmartClient Version: v10.0p_2016-06-15/LGPL Development Only (built 2016-06-15)
Comment