Skip to content

Commit

Permalink
Update code formatting (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcabral committed Nov 11, 2023
1 parent 3eac3a9 commit 10e0b4e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/brsTypes/components/RoDateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,12 @@ export class RoDateTime extends BrsComponent implements BrsValue {
returns: ValueKind.Int32,
},
impl: (interpreter: Interpreter) => {

// From: https://stackoverflow.com/a/68593283
const getOffset = (timeZone = 'UTC', date = new Date()) => {
const utcDate = new Date(date.toLocaleString('en-US', { timeZone: 'UTC' }));
const tzDate = new Date(date.toLocaleString('en-US', { timeZone: timeZone }));
const getOffset = (timeZone = "UTC", date = new Date()) => {
const utcDate = new Date(date.toLocaleString("en-US", { timeZone: "UTC" }));
const tzDate = new Date(date.toLocaleString("en-US", { timeZone: timeZone }));
return (tzDate.getTime() - utcDate.getTime()) / 6e4;
}

};
return new Int32(-getOffset(interpreter.deviceInfo.get("timeZone")));
},
});
Expand Down

0 comments on commit 10e0b4e

Please sign in to comment.