Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed old calendar stuff #212

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
"@fortawesome/free-solid-svg-icons": "6.4.2",
"@types/gapi": "^0.0.47",
"bulma-switch": "^2.0.4",
"ics": "^3.5.0",
"luxon": "^3.4.3",
"node-fetch": "^3.3.2",
"svelte-fa": "^3.0.4",
"svelte-markdown": "^0.4.0",
Expand Down
28 changes: 0 additions & 28 deletions scripts/calendar.ts

This file was deleted.

33 changes: 1 addition & 32 deletions src/components/events/event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import * as ics from "ics";
import { DateTime } from "luxon";
import { error } from "@sveltejs/kit" ;

interface Event<T> {
description: string;
date: [number, number, number];
Expand All @@ -27,31 +23,4 @@ export function getEnd<T>(x: Event<T>): Date {
);
}

export type Events<T> = Event<T>[];

export function getICS<T>(calendarName: string, events: Events<T>): string {
let { error:err, value } = ics.createEvents(
events.map((x) => {
// Convert the start time to UTC
let start = DateTime.fromJSDate(getStart(x)).setZone("Europe/London", { keepLocalTime: true }).toJSDate();
return {
calName: calendarName,
title: x.description,
start: [
start.getUTCFullYear(),
start.getUTCMonth() + 1,
start.getUTCDate(),
start.getUTCHours(),
start.getUTCMinutes(),
],
startInputType: "utc",
duration: { hours: x.duration[0], minutes: x.duration[1] },
location: x.location,
};
}),
);
if (err) {
error(500, err.message);
}
return value;
}
export type Events<T> = Event<T>[];
6 changes: 3 additions & 3 deletions src/routes/get-involved/termcard/termcard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export enum TermcardEventTypes {
soc = "society"
}

export const term = "Summer";
export const term = "Michaelmas";
export const calendarDetails = [
{
calendarId: "webmaster@thejcr.co.uk",
Expand All @@ -14,5 +14,5 @@ export const calendarDetails = [
type: TermcardEventTypes.soc
}
];
export const startDate = new Date(Date.UTC(2024, 7, 18));
export const endDate = new Date(Date.UTC(2024, 7, 25));
export const startDate = new Date(Date.UTC(2024, 9, 1));
export const endDate = new Date(Date.UTC(2024, 11, 8));
51 changes: 1 addition & 50 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1800,15 +1800,6 @@ he@1.2.0:
resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

ics@^3.5.0:
version "3.7.6"
resolved "https://registry.npmjs.org/ics/-/ics-3.7.6.tgz"
integrity sha512-Z1QIWoPzyzqKUSj2Ui9vD3ca0AS+uHyiCjkROFx9PiKtJu9vMuMo6KJ4aqFmMAqn5q3fLq/5tLTJRm4zr9jjgw==
dependencies:
nanoid "^3.1.23"
runes2 "^1.1.2"
yup "^1.2.0"

ignore@^5.2.0, ignore@^5.3.1:
version "5.3.2"
resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz"
Expand Down Expand Up @@ -2105,11 +2096,6 @@ lodash.merge@^4.6.2:
resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

luxon@^3.4.3:
version "3.5.0"
resolved "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz"
integrity sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==

magic-string@^0.30.10, magic-string@^0.30.4, magic-string@^0.30.5:
version "0.30.11"
resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz"
Expand Down Expand Up @@ -2196,7 +2182,7 @@ ms@^2.1.1:
resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

nanoid@^3.1.23, nanoid@^3.3.7:
nanoid@^3.3.7:
version "3.3.7"
resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz"
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
Expand Down Expand Up @@ -2430,11 +2416,6 @@ prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"

property-expr@^2.0.5:
version "2.0.6"
resolved "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz"
integrity sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==

punycode@^2.1.0:
version "2.3.1"
resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz"
Expand Down Expand Up @@ -2532,11 +2513,6 @@ run-parallel@^1.1.9:
dependencies:
queue-microtask "^1.2.2"

runes2@^1.1.2:
version "1.1.4"
resolved "https://registry.npmjs.org/runes2/-/runes2-1.1.4.tgz"
integrity sha512-LNPnEDPOOU4ehF71m5JoQyzT2yxwD6ZreFJ7MxZUAoMKNMY1XrAo60H1CUoX5ncSm0rIuKlqn9JZNRrRkNou2g==

sade@^1.7.4, sade@^1.8.1:
version "1.8.1"
resolved "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz"
Expand Down Expand Up @@ -2850,11 +2826,6 @@ text-table@^0.2.0:
resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==

tiny-case@^1.0.3:
version "1.0.3"
resolved "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz"
integrity sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==

tiny-glob@^0.2.9:
version "0.2.9"
resolved "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz"
Expand All @@ -2875,11 +2846,6 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

toposort@^2.0.2:
version "2.0.2"
resolved "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz"
integrity sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==

totalist@^3.0.0:
version "3.0.1"
resolved "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz"
Expand Down Expand Up @@ -2935,11 +2901,6 @@ type-fest@^0.20.2:
resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

type-fest@^2.19.0:
version "2.19.0"
resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz"
integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==

typed-array-buffer@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz"
Expand Down Expand Up @@ -3091,16 +3052,6 @@ yocto-queue@^0.1.0:
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

yup@^1.2.0:
version "1.4.0"
resolved "https://registry.npmjs.org/yup/-/yup-1.4.0.tgz"
integrity sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==
dependencies:
property-expr "^2.0.5"
tiny-case "^1.0.3"
toposort "^2.0.2"
type-fest "^2.19.0"

zimmerframe@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz"
Expand Down
Loading