From 410ea7167de1abd72c29623ff44a318f32ea5695 Mon Sep 17 00:00:00 2001 From: conceptualspace Date: Sat, 24 Dec 2016 03:24:00 -0500 Subject: [PATCH] Fix for issue #1873 Attempt parsing object (ex Moment.js date object) to date. This was implicitly supported <= 0.4.10 but regressed with narrower validation in #1121. --- src/core.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core.js b/src/core.js index 94ac711..415aa9e 100644 --- a/src/core.js +++ b/src/core.js @@ -1042,6 +1042,8 @@ c3_chart_internal_fn.parseDate = function (date) { parsedDate = date; } else if (typeof date === 'string') { parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date); + } else if (typeof date === 'object') { + parsedDate = new Date(+date); } else if (typeof date === 'number' && !isNaN(date)) { parsedDate = new Date(+date); }