From 2aa78755287bfa3b0518c85c022c84e343022ece Mon Sep 17 00:00:00 2001 From: mpieters3 Date: Sun, 24 Sep 2023 19:14:30 -0700 Subject: [PATCH] Updated to include wetnotes and support recurrence --- package-lock.json | 88 +++++++++++++++++++++++++++++++ package.json | 3 ++ src/components/blog/BlogThree.vue | 3 +- src/components/events/Events.vue | 22 ++++++-- src/components/header/Header.vue | 2 +- src/views/Blog.vue | 4 +- src/views/Home.vue | 4 +- 7 files changed, 113 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6be9146..cc15223 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,9 @@ "beautiful-dom": "^1.0.9", "core-js": "^3.6.5", "feather-icons": "^4.28.0", + "ical": "^0.8.0", + "ical.js": "^1.5.0", + "rrule": "^2.7.2", "vee-validate": "^3.4.5", "vue": "^2.6.14", "vue-axios": "^2.1.5", @@ -7284,6 +7287,27 @@ "node": ">=8.12.0" } }, + "node_modules/ical": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ical/-/ical-0.8.0.tgz", + "integrity": "sha512-/viUSb/RGLLnlgm0lWRlPBtVeQguQRErSPYl3ugnUaKUnzQswKqOG3M8/P1v1AB5NJwlHTuvTq1cs4mpeG2rCg==", + "dependencies": { + "rrule": "2.4.1" + } + }, + "node_modules/ical.js": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-1.5.0.tgz", + "integrity": "sha512-7ZxMkogUkkaCx810yp0ZGKvq1ZpRgJeornPttpoxe6nYZ3NLesZe1wWMXDdwTkj/b5NtXT+Y16Aakph/ao98ZQ==" + }, + "node_modules/ical/node_modules/rrule": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.4.1.tgz", + "integrity": "sha512-+NcvhETefswZq13T8nkuEnnQ6YgUeZaqMqVbp+ZiFDPCbp3AVgQIwUvNVDdMNrP05bKZG9ddDULFp0qZZYDrxg==", + "optionalDependencies": { + "luxon": "^1.3.3" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -8371,6 +8395,15 @@ "yallist": "^3.0.2" } }, + "node_modules/luxon": { + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.1.tgz", + "integrity": "sha512-gYHAa180mKrNIUJCbwpmD0aTu9kV0dREDrwNnuyFAsO1Wt0EVYSZelPnJlbj9HplzXX/YWXHFTL45kvZ53M0pw==", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -11036,6 +11069,14 @@ "inherits": "^2.0.1" } }, + "node_modules/rrule": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.7.2.tgz", + "integrity": "sha512-NkBsEEB6FIZOZ3T8frvEBOB243dm46SPufpDckY/Ap/YH24V1zLeMmDY8OA10lk452NdrF621+ynDThE7FQU2A==", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -12679,6 +12720,11 @@ } } }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -20329,6 +20375,29 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, + "ical": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ical/-/ical-0.8.0.tgz", + "integrity": "sha512-/viUSb/RGLLnlgm0lWRlPBtVeQguQRErSPYl3ugnUaKUnzQswKqOG3M8/P1v1AB5NJwlHTuvTq1cs4mpeG2rCg==", + "requires": { + "rrule": "2.4.1" + }, + "dependencies": { + "rrule": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.4.1.tgz", + "integrity": "sha512-+NcvhETefswZq13T8nkuEnnQ6YgUeZaqMqVbp+ZiFDPCbp3AVgQIwUvNVDdMNrP05bKZG9ddDULFp0qZZYDrxg==", + "requires": { + "luxon": "^1.3.3" + } + } + } + }, + "ical.js": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-1.5.0.tgz", + "integrity": "sha512-7ZxMkogUkkaCx810yp0ZGKvq1ZpRgJeornPttpoxe6nYZ3NLesZe1wWMXDdwTkj/b5NtXT+Y16Aakph/ao98ZQ==" + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -21163,6 +21232,12 @@ "yallist": "^3.0.2" } }, + "luxon": { + "version": "1.28.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.1.tgz", + "integrity": "sha512-gYHAa180mKrNIUJCbwpmD0aTu9kV0dREDrwNnuyFAsO1Wt0EVYSZelPnJlbj9HplzXX/YWXHFTL45kvZ53M0pw==", + "optional": true + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -23386,6 +23461,14 @@ "inherits": "^2.0.1" } }, + "rrule": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.7.2.tgz", + "integrity": "sha512-NkBsEEB6FIZOZ3T8frvEBOB243dm46SPufpDckY/Ap/YH24V1zLeMmDY8OA10lk452NdrF621+ynDThE7FQU2A==", + "requires": { + "tslib": "^2.4.0" + } + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -24745,6 +24828,11 @@ "integrity": "sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==", "dev": true }, + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", diff --git a/package.json b/package.json index e2413a7..546f079 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "beautiful-dom": "^1.0.9", "core-js": "^3.6.5", "feather-icons": "^4.28.0", + "ical": "^0.8.0", + "ical.js": "^1.5.0", + "rrule": "^2.7.2", "vee-validate": "^3.4.5", "vue": "^2.6.14", "vue-axios": "^2.1.5", diff --git a/src/components/blog/BlogThree.vue b/src/components/blog/BlogThree.vue index 6bf3011..cce4951 100644 --- a/src/components/blog/BlogThree.vue +++ b/src/components/blog/BlogThree.vue @@ -129,8 +129,7 @@ ]; const BeautifulDom = require('beautiful-dom'); - - const filteredResult = result.data.items.filter(blog => !!!blog.labels || !!this.showHidden || !blog.labels.includes('hidden')); + const filteredResult = result.data.items.filter(blog => !!this.showHidden || !!!blog.labels || !blog.labels.includes('hidden')); filteredResult.forEach(function(blog, index){ const dom = new BeautifulDom(blog.content); diff --git a/src/components/events/Events.vue b/src/components/events/Events.vue index a51b573..a631e55 100644 --- a/src/components/events/Events.vue +++ b/src/components/events/Events.vue @@ -107,6 +107,8 @@ import 'vue-slick-carousel/dist/vue-slick-carousel.css' // optional style for arrows & dots import 'vue-slick-carousel/dist/vue-slick-carousel-theme.css' + import { RRule, rrulestr } from 'rrule'; + export default { components: { @@ -167,13 +169,23 @@ }, ); + result.data.items.forEach(function(event, index){ - if (event.start.date) { - event.startTime = event.start.date - } else { - event.startTime = event.start.dateTime - } + if (event.recurrence !== undefined) { + const rrule = rrulestr(event.recurrence[0]); + + const now = new Date(); + const nextOccurrence = rrule.after(now, { inc: true }); + event.startTime = nextOccurrence; + } + else { + if (event.start.date) { + event.startTime = event.start.date + } else { + event.startTime = event.start.dateTime + } + } const dateObj = new Date(event.startTime); event.startFriendly = dateObj.toDateString(); diff --git a/src/components/header/Header.vue b/src/components/header/Header.vue index b88c350..275fb5b 100644 --- a/src/components/header/Header.vue +++ b/src/components/header/Header.vue @@ -135,7 +135,7 @@ { title: "Home", to: "/#home" }, { title: "About", to: "/#about" }, { title: "Events", to: "/#events" }, - // { title: "Wetnotes", to: "/#blog" }, + { title: "Wetnotes", to: "/#wetnotes" }, ], icon: "menu", closeIcon: "x", diff --git a/src/views/Blog.vue b/src/views/Blog.vue index 5eb196b..3871aaf 100644 --- a/src/views/Blog.vue +++ b/src/views/Blog.vue @@ -9,13 +9,13 @@
-

Wetnotes Preview

+

Wetnotes

- + diff --git a/src/views/Home.vue b/src/views/Home.vue index 4efe4f4..d40868f 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -119,8 +119,7 @@ -