From aebdeaabc43d8be1a0310dce7a60645e78a716c0 Mon Sep 17 00:00:00 2001 From: Isaac GC Date: Tue, 30 Jan 2024 21:46:44 -0800 Subject: [PATCH] changed variable scopes --- models/Transactional/LedgerPosting.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/Transactional/LedgerPosting.ts b/models/Transactional/LedgerPosting.ts index 1db1404a7..ad8c2c027 100644 --- a/models/Transactional/LedgerPosting.ts +++ b/models/Transactional/LedgerPosting.ts @@ -91,16 +91,16 @@ export class LedgerPosting { } // Timezone inconsistency fix (very ugly code for now) - let entryDateTime = this.refDoc.date as string | Date; + const entryDateTime = this.refDoc.date as string | Date; let dateTimeValue: Date; if (typeof entryDateTime === 'string' || entryDateTime instanceof String) { dateTimeValue = new Date(entryDateTime); } else { dateTimeValue = entryDateTime; } - let dtFixedValue = dateTimeValue; - let dtMinutes = dtFixedValue.getTimezoneOffset() % 60; - let dtHours = (dtFixedValue.getTimezoneOffset() - dtMinutes) / 60; + const dtFixedValue = dateTimeValue; + const dtMinutes = dtFixedValue.getTimezoneOffset() % 60; + const dtHours = (dtFixedValue.getTimezoneOffset() - dtMinutes) / 60; // Forcing the time to always be set to 00:00.000 for locale time dtFixedValue.setHours(0 - dtHours); dtFixedValue.setMinutes(0 - dtMinutes);