Skip to content

Commit

Permalink
changed variable scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-GC committed Jan 31, 2024
1 parent d3a75c8 commit aebdeaa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/Transactional/LedgerPosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aebdeaa

Please sign in to comment.