Skip to content

Commit

Permalink
Changed how datetime was fixed for various timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-GC committed Jan 31, 2024
1 parent 9b2382a commit d3a75c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions models/Transactional/LedgerPosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ export class LedgerPosting {
let dtFixedValue = dateTimeValue;

Check failure on line 101 in models/Transactional/LedgerPosting.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

'dtFixedValue' is never reassigned. Use 'const' instead
let dtMinutes = dtFixedValue.getTimezoneOffset() % 60;

Check failure on line 102 in models/Transactional/LedgerPosting.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

'dtMinutes' is never reassigned. Use 'const' instead
let dtHours = (dtFixedValue.getTimezoneOffset() - dtMinutes) / 60;

Check failure on line 103 in models/Transactional/LedgerPosting.ts

View workflow job for this annotation

GitHub Actions / setup_and_lint

'dtHours' is never reassigned. Use 'const' instead
dtFixedValue.setHours(dtFixedValue.getHours() - dtHours);
dtFixedValue.setMinutes(dtFixedValue.getMinutes() - dtMinutes);
// Forcing the time to always be set to 00:00.000 for locale time
dtFixedValue.setHours(0 - dtHours);
dtFixedValue.setMinutes(0 - dtMinutes);
dtFixedValue.setSeconds(0);

// end ugly timezone fix code

Expand Down

0 comments on commit d3a75c8

Please sign in to comment.