Browse Source

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.
pull/1932/merge
conceptualspace 8 years ago committed by Yoshiya Hinosawa
parent
commit
410ea7167d
  1. 2
      src/core.js

2
src/core.js

@ -1042,6 +1042,8 @@ c3_chart_internal_fn.parseDate = function (date) {
parsedDate = date; parsedDate = date;
} else if (typeof date === 'string') { } else if (typeof date === 'string') {
parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date); parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date);
} else if (typeof date === 'object') {
parsedDate = new Date(+date);
} else if (typeof date === 'number' && !isNaN(date)) { } else if (typeof date === 'number' && !isNaN(date)) {
parsedDate = new Date(+date); parsedDate = new Date(+date);
} }

Loading…
Cancel
Save