fix: render history chart timestamps in ICT (Asia/Bangkok)

This commit is contained in:
2026-08-09 17:19:28 +07:00
parent 2fe1dcf4da
commit 33f2dd45f4
+1 -1
View File
@@ -328,7 +328,7 @@
state.historyChart = new Chart($('history-chart'), { state.historyChart = new Chart($('history-chart'), {
type: 'line', type: 'line',
data: { data: {
labels: rows.map((row) => new Date(row.timestamp).toLocaleString([], { month: 'short', day: 'numeric', hour: '2-digit' })), labels: rows.map((row) => new Date(row.timestamp).toLocaleString('en-TH', { timeZone: 'Asia/Bangkok', month: 'short', day: 'numeric', hour: '2-digit' })),
datasets: [ datasets: [
{ label: 'Discharge (m³/s)', data: rows.map((row) => row.discharge), borderColor: '#087da5', backgroundColor: 'rgba(8,125,165,.12)', yAxisID: 'flow', pointRadius: 0, tension: .25 }, { label: 'Discharge (m³/s)', data: rows.map((row) => row.discharge), borderColor: '#087da5', backgroundColor: 'rgba(8,125,165,.12)', yAxisID: 'flow', pointRadius: 0, tension: .25 },
{ label: 'Water level (m)', data: rows.map((row) => row.water_level), borderColor: '#d99018', yAxisID: 'level', pointRadius: 0, tension: .25 } { label: 'Water level (m)', data: rows.map((row) => row.water_level), borderColor: '#d99018', yAxisID: 'level', pointRadius: 0, tension: .25 }