简体   繁体   English

如何在 React Native 应用程序中创建和管理 icalendar VEvent

[英]How to create and manage icalendar VEvent in react native app

I'm developing a react native application where users can post an event specifying day, time and recurrence (weekly, daily etc...).我正在开发一个反应原生应用程序,用户可以在其中发布指定日期、时间和重复周期(每周、每天等)的事件。 Once these parameters have been set by the user I need to generate an ical VEvent object to send to my backend.一旦用户设置了这些参数,我需要生成一个 ical VEvent object 发送到我的后端。 The backend returns these events in VEvent objects format.后端以 VEvent 对象格式返回这些事件。 In communication with the backend, the VEvent are wrapped in a JSON.在与后端的通信中,VEvent 被包装在 JSON 中。

My question is: is there a javascript library that allows me to create, decode and manage VEvents in iCalendar format?我的问题是:是否有一个 javascript 库允许我创建、解码和管理 iCalendar 格式的 VEvents?

There are some, all you need to do is look for them on npm.js .有一些,你需要做的就是在npm.js上寻找它们。

Unfortunately most of them have been abandoned or don't provide parsing both ways (JSON->iCal, iCal -> JSON).不幸的是,它们中的大多数已被放弃或不提供两种方式的解析(JSON-> iCal,iCal -> JSON)。

Few examples:几个例子:

ics , that goes from JSON -> iCal ics ,来自 JSON -> iCal

ical-generator , again JSON -> iCal ical -generator ,再次 JSON -> iCal

ical2json , JSON -> iCal ical2json , JSON -> iCal

I've been working on package of my own, to fill this void and do parsing both ways, called ikalendar .我一直在研究我自己的 package 来填补这个空白并进行双向解析,称为ikalendar However I'm not trying to use this as a plug as it is still not a 1.0 version and is still in works, therefore I would not recommend it for production use yet.但是我并没有尝试将其用作插件,因为它仍然不是1.0版本并且仍在工作中,因此我不建议将其用于生产用途。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM