date formatting
Shouldn't this give me a formatted date?
<script>
var myData = [['1218', '1387', 'Louis', 'Testlouis', '09/11/2004', ' ', '1', '0', '8', '­', 'dumbo@cox.net', '­', 'f', '1437658946']
]
;
var myColumns = ['aid', 'id', 'fname', 'lname', 'datecompleted', 'remarks', 'rank', 'scweight', 'aweight', 'hiredate', 'email', 'essential', 'commentmade', 'homephone']
;
var obj = new AW.UI.Grid;
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var date = new AW.Formats.Date;
date.setDataFormat("default");
date.setTextFormat("mmm-dd-yyyy");
obj.setCellFormat([num, num, str, str, date, str, num, num, num, str, str, str, str, str])
//provide cells and headers text
obj.setCellText(myData);
obj.setHeaderText(myColumns);
//set number of rows/columns
obj.setRowCount(1);
obj.setColumnCount(14);
//enable row selectors
obj.setSelectorVisible(false);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
//set headers width/height
obj.setSelectorWidth(28);
obj.setHeaderHeight(20);
obj.setVirtualMode(true);
//set row selection
obj.setSelectionMode("single-cell");
//set click action handler
obj.onCellClicked = function(event, col, row){window.status = this.getCellText(col, row)};
obj.setCellEditable(true);
document.write(obj);
</script>
<script>
var myData = [['1218', '1387', 'Louis', 'Testlouis', '09/11/2004', ' ', '1', '0', '8', '­', 'dumbo@cox.net', '­', 'f', '1437658946']
]
;
var myColumns = ['aid', 'id', 'fname', 'lname', 'datecompleted', 'remarks', 'rank', 'scweight', 'aweight', 'hiredate', 'email', 'essential', 'commentmade', 'homephone']
;
var obj = new AW.UI.Grid;
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
var date = new AW.Formats.Date;
date.setDataFormat("default");
date.setTextFormat("mmm-dd-yyyy");
obj.setCellFormat([num, num, str, str, date, str, num, num, num, str, str, str, str, str])
//provide cells and headers text
obj.setCellText(myData);
obj.setHeaderText(myColumns);
//set number of rows/columns
obj.setRowCount(1);
obj.setColumnCount(14);
//enable row selectors
obj.setSelectorVisible(false);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
//set headers width/height
obj.setSelectorWidth(28);
obj.setHeaderHeight(20);
obj.setVirtualMode(true);
//set row selection
obj.setSelectionMode("single-cell");
//set click action handler
obj.onCellClicked = function(event, col, row){window.status = this.getCellText(col, row)};
obj.setCellEditable(true);
document.write(obj);
</script>
Patrick
August 29,