Mic*_*idt 25 javascript android ios jquery-mobile cordova
如何从iOS/Android中的JavaScript/jQuery Mobile/PhoneGap应用程序创建日历事件?
有没有,例如,PhoneGap插件?在官方存储库中没有看到任何内容.
根据下面的评论,现在可以为iOS创建一个iCal文件,为Android创建一个vcs文件.它需要浏览器/设备嗅探,或者给用户选择,但至少应该是可能的.
我意识到这是一个古老的问题,但现在有插件.它有它的缺点,但有效.在撰写本文时,它支持以下功能:
下面是代码示例:
var startDate = new Date(2014,2,15,18,30,0,0,0);
var endDate = new Date(2014,2,15,19,30,0,0,0);
var title = "My nice event";
var newTitle = "My new nice event";
var location = "Home";
var notes = "Some notes about this event.";
var success = function(message) {
alert("Success: " + JSON.stringify(message));
};
var error = function(message) {
alert("Error: " + message);
};
window.plugins.calendar.createEvent(title,location,notes,startDate,endDate,success,error);
window.plugins.calendar.modifyEvent(title,location,notes,startDate,endDate,newTitle,location,notes,startDate,endDate,success,error);
window.plugins.calendar.deleteEvent(newTitle,location,notes,startDate,endDate,success,error);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19803 次 |
| 最近记录: |