diff --git a/server/src/app/routes/dow.ts b/server/src/app/routes/dow.ts index c17a1a9..3926e3d 100644 --- a/server/src/app/routes/dow.ts +++ b/server/src/app/routes/dow.ts @@ -103,7 +103,7 @@ export const dowRoutes = router((router, ctx) => { }, { x: WIDTH / 2, - y: 145, + y: 140, c: `${ Math.round((weather.now?.temperature as number) ?? 0) ?? '-' } C ${summary}`, diff --git a/server/src/app/services/calendar.ts b/server/src/app/services/calendar.ts index a8220a6..9807acf 100644 --- a/server/src/app/services/calendar.ts +++ b/server/src/app/services/calendar.ts @@ -21,7 +21,11 @@ export const calendarService = service((ctx) => async () => { events: async (calendars: string[]) => { const results = [] - const timeMin = DateTime.now().setZone(ctx.config.timeZone).startOf('day') + + const timeMin = DateTime.now() + .setZone(ctx.config.timeZone) + .minus({ minutes: 30 }) + const timeMax = DateTime.now().setZone(ctx.config.timeZone).endOf('day') if (!timeMin.isValid) { @@ -47,7 +51,12 @@ export const calendarService = service((ctx) => async () => { } } - return results + return results.sort((a, b) => { + const aDate = new Date(a.start?.dateTime ?? a.start?.date ?? 0) + const bDate = new Date(b.start?.dateTime ?? b.start?.date ?? 0) + + return aDate.toISOString().localeCompare(bDate.toISOString()) + }) }, } })