From da46703d7dee4df0d5f054e77c160837ef36304e Mon Sep 17 00:00:00 2001 From: justin tucker <129927578+jtuckerfubo@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:53:27 -0700 Subject: [PATCH] Debug logging displays the wrong month. This is caused because Date.getMonth() returns a 0-based month index. The fix is to add 1 for calendar month index. Tested on a benjamin, OS-13.1 --- client/src/OnDeviceComponent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/OnDeviceComponent.ts b/client/src/OnDeviceComponent.ts index 41e27b3..8f82a80 100644 --- a/client/src/OnDeviceComponent.ts +++ b/client/src/OnDeviceComponent.ts @@ -1019,7 +1019,7 @@ export class OnDeviceComponent { private debugLog(message: string, ...args) { if (this.getConfig()?.clientDebugLogging) { const date = new Date; - const formattedDate = `${utils.lpad(date.getMonth())}-${utils.lpad(date.getDate())} ${utils.lpad(date.getHours())}:${utils.lpad(date.getMinutes())}:${utils.lpad(date.getSeconds())}:${utils.lpad(date.getMilliseconds(), 3)}`; + const formattedDate = `${utils.lpad(date.getMonth() + 1)}-${utils.lpad(date.getDate())} ${utils.lpad(date.getHours())}:${utils.lpad(date.getMinutes())}:${utils.lpad(date.getSeconds())}:${utils.lpad(date.getMilliseconds(), 3)}`; console.log(`${formattedDate} [ODC][${this.device.getCurrentDeviceConfig().host}] ${message}`, ...args); } }