Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated unit test to reproduce issue #115

Fixed issue #115
  • Loading branch information...
commit df129de34f0d13a96f4a9fc3c4c93deadb7b920a 1 parent b4fd16d
@mikechambers authored
View
4 src/com/adobe/utils/DateUtil.as
@@ -573,7 +573,9 @@ package com.adobe.utils
var minutes:Number = Number(timeArr.shift());
var secondsArr:Array = (timeArr.length > 0) ? String(timeArr.shift()).split(".") : null;
var seconds:Number = (secondsArr != null && secondsArr.length > 0) ? Number(secondsArr.shift()) : 0;
- var milliseconds:Number = (secondsArr != null && secondsArr.length > 0) ? Number(secondsArr.shift()) : 0;
+ //var milliseconds:Number = (secondsArr != null && secondsArr.length > 0) ? Number(secondsArr.shift()) : 0;
+
+ var milliseconds:Number = (secondsArr != null && secondsArr.length > 0) ? 1000*parseFloat("0." + secondsArr.shift()) : 0;
var utc:Number = Date.UTC(year, month-1, date, hour, minutes, seconds, milliseconds);
var offset:Number = (((offsetHours * 3600000) + (offsetMinutes * 60000)) * multiplier);
finalDate = new Date(utc - offset);
View
5 tests/src/com/adobe/utils/DateUtilTest.as
@@ -33,10 +33,7 @@
package com.adobe.utils
{
import flexunit.framework.TestCase;
- import flexunit.framework.TestSuite;
- import com.adobe.utils.DateUtil;
- import com.adobe.utils.ArrayUtil;
import mx.formatters.DateBase;
public class DateUtilTest extends TestCase
@@ -73,7 +70,7 @@ package com.adobe.utils
//1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30
// am, US Eastern Standard Time.
- var s:String = "1994-11-05T08:15:30-08:00";
+ var s:String = "1994-11-05T08:15:30.123456-08:00";
var d:Date = DateUtil.parseW3CDTF(s);
Please sign in to comment.
Something went wrong with that request. Please try again.