Merge pull request #266 from hulkholden/fix_hidpi
[dygraphs.git] / auto_tests / tests / Util.js
index 53a83f8..0e2c25d 100644 (file)
@@ -133,3 +133,11 @@ Util.overrideXMLHttpRequest = function(data) {
   return FakeXMLHttpRequest;
 };
 
+/**
+ * Format a date as 2000/01/23
+ * @param {number} dateMillis Millis since epoch.
+ * @return {string} The date formatted as YYYY-MM-DD.
+ */
+Util.formatDate = function(dateMillis) {
+  return Dygraph.dateString_(dateMillis).slice(0, 10);  // 10 == "YYYY/MM/DD".length
+};