Skip to content

Commit

Permalink
[Issue-175] Update function getUCTPlus7 for working on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
lw-cdm committed Nov 21, 2024
1 parent a0581c7 commit ae0c0da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/extension-koni-ui/src/connector/booka/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,13 @@ export class BookaSdk {
await wait(1000);

const getUCTPlus7 = (dateString: string) => {
return new Date(dateString + ' UTC+7');
// Split the input date string into components (e.g., "2024-11-20 07:00")
const [datePart, timePart] = dateString.split(' ');
const [year, month, day] = datePart.split('-').map(Number); // Parse date
const [hours, minutes] = timePart.split(':').map(Number); // Parse time

// Create a UTC+7 date object manually
return new Date(Date.UTC(year, month - 1, day, hours - 7, minutes));
};

const eligibilityList = [
Expand Down

0 comments on commit ae0c0da

Please sign in to comment.