update deps

This commit is contained in:
Enrico Bühler 2024-09-17 20:20:02 +02:00
parent 9876261789
commit f44fa8bf7c
3 changed files with 112 additions and 116 deletions

Binary file not shown.

View File

@ -11,32 +11,32 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/mdx": "^3.1.2",
"@astrojs/check": "^0.9.3",
"@astrojs/mdx": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/ts-plugin": "^1.8.0",
"@photo-sphere-viewer/core": "^5.8.1",
"@photo-sphere-viewer/markers-plugin": "^5.8.1",
"@photo-sphere-viewer/virtual-tour-plugin": "^5.8.1",
"@astrojs/ts-plugin": "^1.10.2",
"@photo-sphere-viewer/core": "^5.10.0",
"@photo-sphere-viewer/markers-plugin": "^5.10.0",
"@photo-sphere-viewer/virtual-tour-plugin": "^5.10.0",
"@unom/style": "git+https://git.unom.io/unom/style.git",
"astro": "^4.11.3",
"autoprefixer": "^10.4.19",
"astro": "^4.15.6",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"ical": "^0.8.0",
"keen-slider": "^6.8.6",
"lucide-astro": "^0.399.0",
"marked": "^13.0.1",
"lucide-astro": "^0.441.0",
"marked": "^14.1.2",
"motion": "^10.18.0",
"pannellum": "^2.5.6",
"postcss": "^8.4.39",
"postcss-custom-media": "^10.0.7",
"postcss": "^8.4.47",
"postcss-custom-media": "^11.0.1",
"postcss-import": "^16.1.0",
"prettier-plugin-astro": "^0.14.0",
"tailwind-merge": "^2.3.0",
"prettier-plugin-astro": "^0.14.1",
"tailwind-merge": "^2.5.2",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.5.3"
"typescript": "^5.6.2"
},
"devDependencies": {
"@types/ical": "^0.8.3",

View File

@ -19,8 +19,8 @@ export async function getCalenderIcs() {
export type Event = {
title: string;
start: Date;
end: Date;
start: Date | undefined;
end: Date | undefined;
location: string;
description?: string;
link: string | undefined;
@ -51,12 +51,13 @@ export async function getEvents() {
if (!isRecurring || !e.rrule) return e;
else {
const latest = e.recurrences?.[e.recurrences.length - 1];
if (!latest) {
const duration = e.end !== undefined && e.start !== undefined ? e.end.getTime() - e.start.getTime() : 0;
const duration =
e.end !== undefined && e.start !== undefined
? e.end.getTime() - e.start.getTime()
: 0;
const next = e.rrule.after(new Date(Date.now()), true);
if (!next) {
@ -66,12 +67,9 @@ export async function getEvents() {
e.start = next;
e.end = new Date(next.getTime() + duration);
return e
} else {
return latest
}
return e;
}
return latest;
})
.filter((e) => {
const isFuture = Number(e.end) > Date.now();
@ -93,12 +91,10 @@ export async function getEvents() {
const isRecurring = !!e.rrule;
// console.log(e.description);
if (e.description) {
const lines = e.description.split("\n");
for (let line of lines) {
for (const line of lines) {
const designator = line.substring(0, line.search(":"));
switch (designator) {
@ -113,7 +109,7 @@ export async function getEvents() {
.trim();
break;
default:
description += line + " ";
description += `${line} `;
}
}
}
@ -122,8 +118,8 @@ export async function getEvents() {
const event: Event = {
title: e.summary || "Kein Titel",
start: e.start!,
end: e.end!,
start: e.start,
end: e.end,
location: e.location || "Kein Standort",
description,
link,
@ -134,7 +130,7 @@ export async function getEvents() {
return event;
})
// Sort the events
.sort((a, b) => a.start.getTime() - b.start.getTime());
.sort((a, b) => (a.start?.getTime() || 0) - (b.start?.getTime() || 0));
return futureAndRecurringEvents;
}