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:
@ -99,12 +99,14 @@ timeScale: {
|
|||||||
secondsVisible: false,
|
secondsVisible: false,
|
||||||
rightOffset: 12,
|
rightOffset: 12,
|
||||||
barSpacing: 10,
|
barSpacing: 10,
|
||||||
|
localization: {
|
||||||
timeFormatter: (timestamp) => {
|
timeFormatter: (timestamp) => {
|
||||||
const date = new Date(timestamp);
|
const date = new Date(timestamp);
|
||||||
// Convert to UTC+1 (Central European Time)
|
// Convert to UTC+1 (Central European Time)
|
||||||
const utc1 = new Date(date.getTime() + (date.getTimezoneOffset() * 60000) + 3600000);
|
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')}`;
|
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: {
|
||||||
vertTouchDrag: false,
|
vertTouchDrag: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user