We are trying to filter date with time information (5/18/2009 04:56 AM), data in the listgrid, but the filtering doesnt seems to work. If we remove the time information, the filtering works fine, our listgrid definition is given below. We are converting the date and timestamp information to the above format using javascript.
isc.ListGrid.create({
//width: 300,top:100,
ID: "myGrid",
dataSource:"myDS",
canEdit: false,
autoDraw:false,
emptyMessage:"",
alternateRecordStyles:true,
autoFetchData : true,
showFilterEditor: true,
canSort : true,
autoSaveEdits: false,
filterOnKeypress:true,
dataProperties:{
fetchMode:"local",
useClientFiltering:true
},
canReorderFields: false,
fields:[
{name:"Nm1", title:"Standard Name"},
{name:"lastUpdateDate", title:"Last Update Date",type:"date", align:"left",
formatCellValue :function(value, record, rowNum, colNum, grid){
return convertMilitaryDate(value);
}
}
]
});
function convertMilitaryDate(value){
var Hour = value.getUTCHours();
var AMorPM = "AM";
// code to return AM or PM
if (Hour > 12) {
AMorPM = "PM";
}
// code to convert 24 hour to 12 hour clock (integer 0-11)
if (Hour > 12){
Hour = Hour-12;
}
if (Hour == 0){
Hour = 12;
}
return (value.getUTCMonth()+1).stringify()
+ "/"
+ value.getUTCDate().stringify()
+ "/"
+ value.getUTCFullYear()
+ " "
+ Hour.stringify()
+ ":"
+ value.getUTCMinutes().stringify()
+ ":"
+ value.getUTCSeconds().stringify()
+ " "
+AMorPM;
}
We are getting Webservice date format in SOAP response.(YYYY-MM-DDTHH:MM:SS)
Please help.