SmartGWT version 6.0-p20160713
Hi,
I would like to know if it is possible to get Date (or DateTime) from ListGrid in some specified format.
Example (very simplified code - we used same methods but spread through the code):
This assigns "Tue Nov 10 2015 00:00:00 GMT+0100 (Central Europe Daylight Time)" in var,
I tried other format properties and although appearance in ListGrid is changed based on those properties, i wasnt able to change string returned by getAttribute method.
Is there any way to specify the requested format of the strings from date columns (set it either on ListGrid, or ListGridField), or is the only way to do it to call getAttributeAsDate("date") (which would require check on type of column and formatting Date afterwards)?
Hi,
I would like to know if it is possible to get Date (or DateTime) from ListGrid in some specified format.
Example (very simplified code - we used same methods but spread through the code):
Code:
ListGrid listGrid = new ListGrid(); ListGridField field = new ListGridField("date", "Date"); field.setFormat("dd:MM:yyyy"); listGrid.setFields(field); ListGridRecord record = new ListGridRecord(); record.setAttribute("date", value); // value is of time Date treeGrid.setData(new ListGridRecord[] { record}); String var = treeGrid.getRecord(0).getAttribute("date");
I tried other format properties and although appearance in ListGrid is changed based on those properties, i wasnt able to change string returned by getAttribute method.
Is there any way to specify the requested format of the strings from date columns (set it either on ListGrid, or ListGridField), or is the only way to do it to call getAttributeAsDate("date") (which would require check on type of column and formatting Date afterwards)?
Comment