From ea407f0382e0ef1805ceea52105d2ec2e30426fa Mon Sep 17 00:00:00 2001 From: brownman Date: Wed, 18 May 2016 10:46:10 +0300 Subject: [PATCH] Fix: Failed to parse x '1463498940000' to Date object when parameter:date is an Array with 1 element of type number --- src/core.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core.js b/src/core.js index 7a933d5..3472033 100644 --- a/src/core.js +++ b/src/core.js @@ -1038,7 +1038,10 @@ c3_chart_internal_fn.parseDate = function (date) { parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date); } else if (typeof date === 'number' && !isNaN(date)) { parsedDate = new Date(+date); + } else if (Array.isArray(date) && date[0]) { + parsedDate = new Date(+date[0]); } + if (!parsedDate || isNaN(+parsedDate)) { window.console.error("Failed to parse x '" + date + "' to Date object"); }