Just for the record, Javascript will not work in Flex directly.Im sure you know this.
Now datejs is a really cool library.What you should really do is, use the advantages of JS in AS using the externalInterface class.
Use the following code in AS3, and make sure to include datejs.js , in the html wrapper, in which this AS3 generated swf will be used.
//--------CODE IN AS-----------------//
public function returnDate(date:String):void
{
Alert.show(date);
}
ExternalInterface.addCallback("returnDate",returnDate);
public function parseDate(userInputString:String):void
{
ExternalInterface.call("parseStringByUser",userInputString);
}
//------------CODE IN JS----------------//
function parseStringByUser(userInputString)
{
var parsedDate= Date.parse(userInputString);
//the line below calls the AS3 function , as AS3 itself exposed it using the ExternalInterface.
returnDate(parsedDate);
}
For externalInterface details you can view :
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html