Update chartjs-plugin-tick-duplicate.ts

This commit is contained in:
Nate Kelley 2025-04-18 12:19:01 -06:00
parent ec4a851bda
commit ddde654a0a
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 0 additions and 11 deletions

View File

@ -4,17 +4,6 @@ declare module 'chart.js' {
interface PluginOptionsByType<TType extends ChartType> {}
}
const safeFormat = (adapter, value, formatStr) => {
try {
return adapter.format(value, formatStr);
} catch {
console.log('safeFormat', value, formatStr);
// fallback to toISOString + slicing or your own logic
const date = new Date(value);
return date.toLocaleString('default', { month: 'short' }); // e.g., 'Jan'
}
};
export const ChartJSTickDuplicatePlugin: Plugin<ChartType> = {
id: 'chartjs-plugin-tick-duplicate',
afterBuildTicks(chart) {