Skip to content

Commit f63a2ec

Browse files
committed
chore: remove ics download link
1 parent 7ccb833 commit f63a2ec

1 file changed

Lines changed: 0 additions & 42 deletions

File tree

app/pages/recharging.vue

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -57,48 +57,6 @@ const icons = [
5757
'i-lucide:star',
5858
'i-lucide:moon',
5959
] as const
60-
61-
// --- .ics calendar reminder ---
62-
63-
// Format as UTC for the .ics file
64-
const fmt = (d: Date) =>
65-
d
66-
.toISOString()
67-
.replace(/[-:]/g, '')
68-
.replace(/\.\d{3}/, '')
69-
70-
// Pick a random daytime hour (9–17) in the user's local timezone on Feb 22
71-
// so reminders are staggered and people don't all flood in at once.
72-
function downloadIcs() {
73-
const hour = 9 + Math.floor(Math.random() * 9) // 9..17
74-
const start = new Date(2026, 1, 22, hour, 0, 0) // month is 0-indexed
75-
const end = new Date(2026, 1, 22, hour + 1, 0, 0)
76-
77-
const uid = `npmx-vacations-${start.getTime()}@npmx.dev`
78-
79-
const ics = [
80-
'BEGIN:VCALENDAR',
81-
'VERSION:2.0',
82-
'PRODID:-//npmx//recharging//EN',
83-
'BEGIN:VEVENT',
84-
`DTSTART:${fmt(start)}`,
85-
`DTEND:${fmt(end)}`,
86-
`SUMMARY:npmx Discord is back!`,
87-
`DESCRIPTION:The npmx team is back from vacation. Time to rejoin! https://chat.npmx.dev`,
88-
'STATUS:CONFIRMED',
89-
`UID:${uid}`,
90-
'END:VEVENT',
91-
'END:VCALENDAR',
92-
].join('\r\n')
93-
94-
const blob = new Blob([ics], { type: 'text/calendar;charset=utf-8' })
95-
const url = URL.createObjectURL(blob)
96-
const a = document.createElement('a')
97-
a.href = url
98-
a.download = 'npmx-discord-reminder.ics'
99-
a.click()
100-
URL.revokeObjectURL(url)
101-
}
10260
</script>
10361

10462
<template>

0 commit comments

Comments
 (0)