Hi ibibas,

How would I set up a function to accept an argument like this:

getCurrentDate(myDateFieldNameHere);

I know this isn't correct:
function getCurrentDate(myArg)
{
var myArg;
myArg.selectedDate = new Date();
}

I would like to make the function generic so I could reuse it on other screens
using the same external AS file.

thanks,
-Art


Quoting [EMAIL PROTECTED]:

Once created the datefield, use this code in a ActionScript function:

inputDate.selectedDate = new Date();

where inputDate:

<mx:DateField id="inputDate" dateFormatter="formatDate" />

You can format it using this function:

function formatDate(item) {
var df:DateFormatter = new DateFormatter();

df.formatString = "DD/MM/YYYY"; // this the mask

return df.format(item);
}


Hope it helps...;-)


Isaac Bib�s Forado






Yahoo! Groups Links










Reply via email to