Open GoogleCodeExporter opened 9 years ago
I believe DateConverter should be changed to something like the following to
handle nulls or bad string
parsing
override public function toString(obj:Object):String
{
var date:Date = obj as Date;
if (date && !isNaN(date.time))
{
return (String(date.fullYear+"-"+addLeadingZero((date.month+1))+"-
"+addLeadingZero(date.date)+"
"+addLeadingZero(date.hours)+":"+addLeadingZero(date.minutes)+":"+addLeadingZero
(date.seconds)+"."+da
te.milliseconds));
}
else
{
return null;
}
}
public override function fromString(value:String):Object{
var date:Date = null;
if (value && value.length > 0)
{
date.setFullYear(Number(value.substr(0,4)), Number(value.substr(5,2))-
1,Number(value.substr(8,2)))
date.setHours(Number(value.substr(11,2)), Number(value.substr(14,2)),
Number(value.substr(17,2)), Number(value.substr(20,3)));
if (isNaN(date.time))
{
date = null;
}
}
return date;
}
Original comment by mderi...@gmail.com
on 15 Dec 2009 at 3:40
Original issue reported on code.google.com by
yukel...@gmail.com
on 30 Mar 2009 at 12:57