Skip to content

Error with dayjs date for abscissa

Hello,

I encounter an error when using the adpater with dayjs date for abscissa value.

Chartjs call adapter's parse method and this method always return null.

` parse: function (value: any, format?: TimeUnit) { const valueType = typeof value;

if (value === null || valueType === 'undefined') {
  return null;
}

if (valueType === 'string' && typeof format === 'string') {
  return dayjs(value, format).isValid() ? dayjs(value, format).valueOf() : null;
} else if (!(value instanceof dayjs)) {
  return dayjs(value).isValid() ? dayjs(value).valueOf() : null;
}
return null;

}, `

the last if (if (!(value instanceof dayjs)) ) shouldn't it be removed?

Thank you,

Maxime