-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ICS Feed support #13337
feat: Add ICS Feed support #13337
Conversation
@mogery is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe/Alipay. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
|
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
awesome initiative this will come handy for many people using ics |
// for Apple's Travel Time feature only (for now) | ||
const getTravelDurationInSeconds = (vevent: ICAL.Component) => { | ||
const travelDuration: ICAL.Duration = vevent.getFirstPropertyValue("x-apple-travel-duration"); | ||
if (!travelDuration) return 0; | ||
|
||
// we can't rely on this being a valid duration and it's painful to check, so just try and catch if anything throws | ||
try { | ||
const travelSeconds = travelDuration.toSeconds(); | ||
// integer validation as we can never be sure with ical.js | ||
if (!Number.isInteger(travelSeconds)) return 0; | ||
return travelSeconds; | ||
} catch (e) { | ||
return 0; | ||
} | ||
}; | ||
|
||
const applyTravelDuration = (event: ICAL.Event, seconds: number) => { | ||
if (seconds <= 0) return event; | ||
// move event start date back by the specified travel time | ||
event.startDate.second -= seconds; | ||
return event; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how much this is actually needed? it certainly doesn't hurt though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, code wise this looks really good too; Happy to approve - Thank you!
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
So cool! 😎 |
* feat: ics-feed proof of concept pt. 1 * feat: ics-feedcalendar fixes * fix: ics feed i18n and icon issues * fix: remove debug log * chore: revert yarn.lock * fix: remove debug log --------- Co-authored-by: Omar López <zomars@me.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
Really cool! Is this already live on the cal.com version yet? I can't seem to find it... |
Someone added the labels for milestone v3.9, v3.8. So when 3.9 is out for sure this seems included! |
I'm getting the same error as @wivaku as described in issue #3167. I shared an Outlook 365 calendar under my control with full view permissions, with URL in the form of
@mogery @emrysal and other developers: Can you please advise? Thank you!! |
What does this PR do?
Adds an "ICS Feed" app to the app store that allows the linking of ICS Feeds for usage via
getAvailability
Fixes #3167
/claim #3167
Type of change
How should this be tested?
Criteria:
There's an ICS feed of German holidays in #3167 that I used for testing.