Running the code below you will see the date shown on the grid as "02/2019" and in the alert as "02/27/2019 12:22".
I expected the datasouce to use the field information in order to correctly convert the data to text.
We are running "Version v12.0p_2019-02-20/Enterprise Deployment (2019-02-20)"
I expected the datasouce to use the field information in order to correctly convert the data to text.
We are running "Version v12.0p_2019-02-20/Enterprise Deployment (2019-02-20)"
Code:
DataSource dataSource = new DataSource(); dataSource.setUseOfflineStorage(true); DataSourceField dateTimeField = new DataSourceField("dateTime", FieldType.DATETIME); dateTimeField.setFormat("MM/YYYY"); dataSource.setFields(dateTimeField); Record record = new Record(); record.setAttribute("dateTime", new Date()); Record[] records = new Record[] { record }; ListGrid listGrid = new ListGrid(dataSource); listGrid.setData(records); listGrid.draw(); Window.alert(dataSource.recordsAsText(records));
Comment