Skip to content

Commit

Permalink
Minor fixing on displaying dates on graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Camlane committed Aug 11, 2025
1 parent 0650030 commit 8e19207
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/lib/chartTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,16 @@ export function createStockChartBaseConfig({
): string {
const extremes = this.axis.getExtremes();
const zoomLevel = extremes.max - extremes.min; // Get the current zoom range
if (zoomLevel <= 12 * 30 * 24 * 3600 * 1000) {
if (zoomLevel <= 10 * 24 * 3600 * 1000) {
return (
Highcharts.dateFormat("%H:%M", Number(this.value)) +
"<br>" +
Highcharts.dateFormat(
"%d %b %Y",
Number(this.value),
)
);
} else if (zoomLevel <= 12 * 30 * 24 * 3600 * 1000) {
return Highcharts.dateFormat(
"%d %b %Y",
Number(this.value),
Expand Down

0 comments on commit 8e19207

Please sign in to comment.