Dygraph.dateString_: shows milliseconds if any. (#774)
[dygraphs.git] / auto_tests / tests / date_formats.js
index f157b8d..5148fe7 100644 (file)
@@ -36,4 +36,12 @@ it('testHyphenatedDate', function() {
   assert.equal(Date.UTC(2000, 1, 2), utils.dateParser(str));
 });
 
+it('testMillisecondsDate', function() {
+  // Format: YYYY-MM-DD HH:MM:SS.MS
+
+  // Midnight February 2, 2000 14:25:42.123 UTC
+  var ts = Date.UTC(2000, 1, 2, 14, 25, 42, 123);
+  assert.equal("2000/02/02 14:25:42.123", utils.dateString_(ts, true));
+});
+
 });