Skip to content

Commit

Permalink
fix: handle cases where dates are corrupted in ics
Browse files Browse the repository at this point in the history
  • Loading branch information
kernoeb committed Feb 20, 2024
1 parent 39ad765 commit 01ce507
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@

# Other stuff
!resources/check-plannings-json.mjs

# Patches
!patches
2 changes: 1 addition & 1 deletion .idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/dataSources/a3958675-dcf7-490d-b6e1-3516deac097e.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN chown -R node:node /home/node/build
USER node

# Only copy the files we need for the moment
COPY --chown=node:node patches patches
COPY --chown=node:node package.json package-lock.json ./
RUN npm ci

Expand Down
259 changes: 259 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint": "eslint --ext .js,.vue,.mjs --ignore-path .gitignore .",
"start": "node --max-old-space-size=2048 node_modules/nuxt/bin/nuxt.js start",
"test": "docker compose -f docker-compose-dev.yml up -d --remove-orphans && NODE_ENV=test mocha --exit test/calendar.test.js test/urls.test.js",
"real-world-test": "docker compose -f docker-compose-test.yml up -d --build --remove-orphans"
"real-world-test": "docker compose -f docker-compose-test.yml up -d --build --remove-orphans",
"postinstall": "patch-package"
},
"dependencies": {
"@dansmaculotte/nuxt-security": "0.0.6",
Expand Down Expand Up @@ -78,6 +79,7 @@
"eslint-plugin-vue": "9.21.0",
"mocha": "10.2.0",
"nuxt": "2.17.3",
"patch-package": "^8.0.0",
"sass-loader": "10",
"supertest": "6.3.4",
"v-tooltip": "2.1.3",
Expand Down
12 changes: 12 additions & 0 deletions patches/cal-parser+1.0.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/cal-parser/index.js b/node_modules/cal-parser/index.js
index ccbe1b5..8333aa5 100644
--- a/node_modules/cal-parser/index.js
+++ b/node_modules/cal-parser/index.js
@@ -177,6 +177,7 @@ function getLines(icalString) {
}

function getDate(type, value) {
+ if (!value.endsWith('Z')) value += 'Z'
return type ? new Date(value.substring(0, 4), parseInt(value.substring(4, 6)) - 1, value.substring(6, 8)) : iCalDateParser(value);
}

0 comments on commit 01ce507

Please sign in to comment.