-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Task #223114 chore: resolved timezone issues
- Loading branch information
Showing
6 changed files
with
183 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
export function getTimezoneCurrentDate(timeZone: string) { | ||
const nowUtc = new Date(); | ||
const nowTimezone = new Date(nowUtc.toLocaleString('en-US', { timeZone: timeZone })); | ||
export function getTimezoneDate(timeZone: string, nowUtc: Date = new Date()) { | ||
// converts the current date(UTC) to the timezone -> 2024-07-15T11:07:09.827Z => 2024-07-15T16:37:09.827Z | ||
const nowTimezone = new Date( | ||
nowUtc.toLocaleString('en-US', { timeZone: timeZone }), | ||
); | ||
|
||
const offset = nowTimezone.getTimezoneOffset() * 60000; | ||
const offset = nowTimezone.getTimezoneOffset() * 60000; | ||
|
||
return new Date(nowTimezone.getTime() - offset) //.toISOString() //.slice(0, -1); | ||
} | ||
return new Date(nowTimezone.getTime() - offset); //.toISOString() //.slice(0, -1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
// structure for server responses | ||
export interface ServerResponse { | ||
// api id | ||
id: string; | ||
// api id | ||
id: string; | ||
|
||
// response param | ||
params: Params; | ||
// response param | ||
params: Params; | ||
|
||
// response code | ||
responseCode: string; | ||
// response code | ||
responseCode: string; | ||
|
||
//server result | ||
result: any; | ||
//server result | ||
result: any; | ||
|
||
// time stamp | ||
ts: string; | ||
// time stamp | ||
ts: string; | ||
|
||
// api version | ||
ver: string; | ||
// api version | ||
ver: string; | ||
|
||
headers?: any; | ||
headers?: any; | ||
} | ||
|
||
export interface Params { | ||
resmsgid: string; | ||
error?: string; | ||
status: string; | ||
errmsg?: string; | ||
resmsgid: string; | ||
error?: string; | ||
status: string; | ||
errmsg?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
export enum EventTypes { | ||
online = 'online', | ||
offline = 'offline', | ||
online = 'online', | ||
offline = 'offline', | ||
} | ||
|
||
export enum EventStatus { | ||
active = 'active', | ||
inactive = 'inactive', | ||
completed = 'completed', | ||
active = 'active', | ||
inactive = 'inactive', | ||
completed = 'completed', | ||
} | ||
|
||
export type MeetingDetails = { | ||
id: string; | ||
url: string; | ||
password: string; | ||
} | ||
|
||
id: string; | ||
url: string; | ||
password: string; | ||
}; |
Oops, something went wrong.