I am grabbing a node from XML that returns the date like this :
2011-06-24T03:00:00
If I try to run new Date I am getting a NaN error.
var shippedDate = new Date($j(this).find("Shipment").find("Date").text())
$j("#result").append(shippedDate.getDate() + "/" + shippedDate.getMonth() + "/" + shippedDate.getFullYear() );
I am thinking I need to use a regular expression to grab everything before the T and drop the rest then it will work ?
Can someone please show me what that regex would look like or if there is another solution?
I think there might be an issue with how you are calling
$j(this)because when I strip it all out, it works:http://jsfiddle.net/jasongennaro/Ry9u8/