fix unkonwn bug
Some checks failed
Deploy MyApp on Same Server / build-and-deploy (push) Failing after 0s

This commit is contained in:
2025-11-27 17:02:05 +03:30
parent 0e812a45c5
commit 2f95c22796

View File

@@ -136,13 +136,18 @@ export default function TelemetryPage() {
}, [selectedDate, loadData])
const sortedTelemetry = useMemo(() => {
return [...telemetry].sort((a, b) => new Date(a.serverTimestampUtc).getTime() - new Date(b.serverTimestampUtc).getTime())
return [...telemetry].sort((a, b) => {
const aTime = a.serverTimestampUtc || a.timestampUtc
const bTime = b.serverTimestampUtc || b.timestampUtc
return new Date(aTime).getTime() - new Date(bTime).getTime()
})
}, [telemetry])
// تبدیل timestamp به ساعت (HH:MM:SS)
const labels = useMemo(() => {
return sortedTelemetry.map(t => {
const date = new Date(t.serverTimestampUtc)
const timestamp = t.serverTimestampUtc || t.timestampUtc
const date = new Date(timestamp)
const hours = date.getHours().toString().padStart(2, '0')
const minutes = date.getMinutes().toString().padStart(2, '0')
const seconds = date.getSeconds().toString().padStart(2, '0')