X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2FUtil.js;h=0e2c25d609d67275390ae04ed28fd695915d1b1c;hb=b4c7f0ad4b0e91eb39b84fc10066dc7e1a6ed4f6;hp=53a83f8130515a86bfc8264c3eb609e65d706d7d;hpb=378194819965ebefef3b6c93e180cf343dcff997;p=dygraphs.git diff --git a/auto_tests/tests/Util.js b/auto_tests/tests/Util.js index 53a83f8..0e2c25d 100644 --- a/auto_tests/tests/Util.js +++ b/auto_tests/tests/Util.js @@ -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 +};