Web: Hapus konversi timezone (database sudah WIB)

This commit is contained in:
flemss 2026-06-15 03:56:28 +07:00
parent 8f27c7535e
commit f3a57b4d76
1 changed files with 2 additions and 4 deletions

View File

@ -189,13 +189,11 @@ export default function ControlPanel() {
const result = await response.json()
if (result.success && result.data && result.data.length > 0) {
// Convert data ke format grafik (24 jam terakhir)
// Database sudah menyimpan WIB, langsung pakai saja
const chartData: DataPoint[] = result.data.map((item: SensorData, index: number) => {
const date = new Date(item.createdAt)
// Konversi ke WIB (UTC+7)
const wibDate = new Date(date.getTime() + (7 * 60 * 60 * 1000))
return {
jam: wibDate.getUTCHours(),
jam: date.getUTCHours(),
suhu: item.suhu
}
}).reverse()