Fix: Move timeFormatter to localization object

The timeFormatter must be inside localization.timeScale to properly format
time axis labels. This ensures the x-axis time labels display UTC+1 time correctly.
This commit is contained in:
DiTus
2026-03-01 20:20:30 +01:00
parent 234e293256
commit e52b177102

View File

@ -99,11 +99,13 @@ timeScale: {
secondsVisible: false, secondsVisible: false,
rightOffset: 12, rightOffset: 12,
barSpacing: 10, barSpacing: 10,
timeFormatter: (timestamp) => { localization: {
const date = new Date(timestamp); timeFormatter: (timestamp) => {
// Convert to UTC+1 (Central European Time) const date = new Date(timestamp);
const utc1 = new Date(date.getTime() + (date.getTimezoneOffset() * 60000) + 3600000); // Convert to UTC+1 (Central European Time)
return `${String(utc1.getMonth() + 1).padStart(2, '0')}/${String(utc1.getDate()).padStart(2, '0')} ${String(utc1.getHours()).padStart(2, '0')}:${String(utc1.getMinutes()).padStart(2, '0')}`; const utc1 = new Date(date.getTime() + (date.getTimezoneOffset() * 60000) + 3600000);
return `${String(utc1.getMonth() + 1).padStart(2, '0')}/${String(utc1.getDate()).padStart(2, '0')} ${String(utc1.getHours()).padStart(2, '0')}:${String(utc1.getMinutes()).padStart(2, '0')}`;
}
} }
}, },
handleScroll: { handleScroll: {