Public
Like
1
availability-calendar
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sends PTO reminders to Slack from shared team Google Calendar.
- Monday: Weekly summary of ALL OOOs overlapping this week
- Tue-Thu: Tomorrow reminders for NEW OOOs starting next day
- Fri-Sun: No notifications
-
Remix this val
-
Go to pipedream.val.run
-
Configure the following for your shared calendar:
-
Copy the generated code into
googleCalendar.ts
- Go to api.slack.com/apps
- Create app → From Scratch → Select workspace
- Incoming Webhooks → Toggle ON → Add New Webhook
- Select your #ooo channel → Copy webhook URL
- Add environment variable:
SLACK_WEBHOOK_URL
= webhook URL
The code handles several edge cases that Google Calendar API presents:
- All-day vs timed events: All-day events use
date
format while timed events usedateTime
- API pagination: Must specify
timeMin
/timeMax
parameters to get all events - Event consolidation: Multiple PTO entries for same person are merged into date ranges
- Partial days: Timed events less than 8 hours are marked as "partial"
- Name extraction: Supports both
[name] PTO
format and first-word extraction from titles
Cron