Skip to content

Commit

Permalink
Fix deleting passed events
Browse files Browse the repository at this point in the history
  • Loading branch information
junajan committed Nov 3, 2024
1 parent 108cea5 commit 0745f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/services/google-calendar.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {calendar_v3, google} from 'googleapis';
import { calendar_v3, google } from 'googleapis';
import { getDateFromDateTime } from "../utils/common.util.ts";

export default class GoogleCalendarService {
scopes: string[] = ['https://www.googleapis.com/auth/calendar'];
Expand Down Expand Up @@ -47,8 +48,7 @@ export default class GoogleCalendarService {
}

async listFutureEvents(): Promise<Array<calendar_v3.Schema$Event>> {
const offsetDate = new Date();
offsetDate.setTime(0);
const offsetDate = new Date(getDateFromDateTime(new Date()));

const result = await this.calendar.events.list({
calendarId: this.calendarId,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"scripts": {
"accept-calendar-invitation": "npx tsx ./commands/accept-calendar-invitation.command.ts",
"dev": "npx tsx watch app/app.ts",
"prod:start": "forever start -a --uid trading-calendar -c 'npx tsx' ./app/app.ts",
"prod:stop": "forever stop trading-calendar",
"single": "npx tsx app/app.ts --single",
Expand Down

0 comments on commit 0745f1f

Please sign in to comment.