Formatting Date in MSPJGrid.

A

aruljohnson

Hi,

I am developing an application that uses mspjgrid for
displaying/editing the task information. So I have made the date
fields(Start & Finish) as editable, but it always displays the dates in
datetime format. I need to display it in "mm/dd/yyyy" format. pls
suggest me a solution!

Following is the code that I am using:

//Code
var rs = new ActiveXObject("ADODB.Recordset");
rs.CursorLocation = adUseClient;

rs.Fields.Append("TASK_UID", adInteger, -1, 0);
rs.Fields.Append("TASK_UID_SUMMARY", adInteger, -1, 0);
rs.Fields.Append("TASK_NAME", adVarWChar, -1, 0);
rs.Fields.Append("DURATION", adVarWChar, -1, 0);
rs.Fields.Append("ASSN_START_DATE", adVariant, -1, 0);
rs.Fields.Append("ASSN_FINISH_DATE", adVariant, -1, 0);

var fieldnames = new Array();
fieldnames[0] = "TASK_UID";
fieldnames[1] = "TASK_UID_SUMMARY";
fieldnames[2] = "TASK_NAME";
fieldnames[3] = "DURATION";
fieldnames[4] = "ASSN_START_DATE";
fieldnames[5] = "ASSN_FINISH_DATE";

var fieldvalues = new Array();

dStart = new Date(January 2,2004);
dFinish = new Date("January 2,2004");

fieldvalues[0] = 1;
fieldvalues[1] = -1;
fieldvalues[2] = "Facility Information/ Project Profile";
fieldvalues[3] = dStart.getVarDate();
fieldvalues[4] = dFinish.getVarDate();

MSPJGrid.FieldList="TASK_UID[ProjectID]{25},#+TASK_NAME[TaskName],+DURATION[Duration],+ASSN_START_DATE[Start]<4>,+ASSN_FINISH_DATE[Finish]<4>
//Code
I guess something needs to be set in the date picker!

Thanks
Arul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top