fix: ics timing
This commit is contained in:
parent
a26e34f2ef
commit
49d91bb581
3 changed files with 10 additions and 14 deletions
|
@ -171,31 +171,27 @@ export const albumReleasesCalendar = (collection) => {
|
||||||
const events = albumReleases.map(album => {
|
const events = albumReleases.map(album => {
|
||||||
const date = DateTime.fromFormat(album.date, 'MMMM d, yyyy')
|
const date = DateTime.fromFormat(album.date, 'MMMM d, yyyy')
|
||||||
if (!date.isValid) return null
|
if (!date.isValid) return null
|
||||||
|
|
||||||
return {
|
return {
|
||||||
start: [
|
start: [date.year, date.month, date.day],
|
||||||
date.year,
|
|
||||||
date.month,
|
|
||||||
date.day
|
|
||||||
],
|
|
||||||
startInputType: 'local',
|
startInputType: 'local',
|
||||||
startOutputType: 'local',
|
startOutputType: 'local',
|
||||||
duration: { days: 1 },
|
title: `Release: ${album.artist} - ${album.title}`,
|
||||||
title: `Release: ${album.artist} / ${album.title}`,
|
|
||||||
description: `Check out this new album release: ${album.url}`,
|
description: `Check out this new album release: ${album.url}`,
|
||||||
url: album.url,
|
url: album.url,
|
||||||
uid: `${date.toFormat('yyyyMMdd')}-${album.artist}-${album.title}@coryd.dev`,
|
uid: `${date.toFormat('yyyyMMdd')}-${album.artist}-${album.title}@coryd.dev`,
|
||||||
timestamp: DateTime.now().toUTC().toFormat('yyyyMMdd\'T\'HHmmss\'Z\'') // Correctly format DTSTAMP
|
timestamp: DateTime.now().toUTC().toFormat("yyyyMMdd'T'HHmmss'Z'")
|
||||||
}
|
};
|
||||||
}).filter(event => event !== null)
|
}).filter(event => event !== null)
|
||||||
|
|
||||||
const { error, value } = ics.createEvents(events)
|
const { error, value } = ics.createEvents(events)
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('Error creating events:', error)
|
console.error('Error creating events: ', error)
|
||||||
events.forEach((event, index) => {
|
events.forEach((event, index) => {
|
||||||
console.error(`Event ${index}:`, event)
|
console.error(`Event ${index}:`, event)
|
||||||
})
|
})
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value
|
||||||
}
|
}
|
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.5.2",
|
"version": "21.5.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.5.2",
|
"version": "21.5.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cdransf/api-text": "^1.4.0",
|
"@cdransf/api-text": "^1.4.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "21.5.2",
|
"version": "21.5.3",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Reference in a new issue