电话间隙中的日期;工作不正常
Date in phonegap doesn't work correctly
当我在应用程序和手机日历中保存会议时。在我的申请中,我正常地得到了日期。但在日历(移动本机)中,我找到了dateStart 10h00,dateEnd 10h00。
我用这段代码从这个github日历插件将会议保存在日历中。
var startDate = new Date(2014,4,18,9,0,0,0,1);
//The time in console : Fri Apr 18 2014 9:00:00 GMT+0100 (BST)
var endDate = new Date(2014,4,18,10,0,0,0,1);
var title = "My 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); };
var calOptions = window.plugins.calendar.getCalendarOptions(); // grab the defaults
calOptions .firstReminderMinutes = 60; // default is 60, pass in null for no reminder (alarm)
window.plugins.calendar.createEventWithOptions(title,location,notes,startDate,endDate,calOptions,success,error);
在你发布的代码片段中,我可以看到你没有options
变量,你在中使用了它
window.plugins.calendar.createEventWithOptions(title,location,notes,startDate,endDate,options,success,error);
试试这个更新的片段:
var startDate = new Date(2014,4,18,9,0,0,0,1);
//The time in console : Fri Apr 18 2014 9:00:00 GMT+0100 (BST)
var endDate = new Date(2014,4,18,10,0,0,0,1);
var title = "My 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); };
var calOptions = window.plugins.calendar.getCalendarOptions(); // grab the defaults
calOptions.firstReminderMinutes = 120; // default is 60, pass in null for no reminder (alarm)
window.plugins.calendar.createEventWithOptions(title,location,notes,startDate,endDate,calOptions,success,error);
相关文章:
- Javascript.getHours()工作不正常
- removeClass函数没有'工作不正常
- jQuery Ajax GET请求工作不正常
- Cordova ng路线工作不正常
- 更新属性工作不正常Meteor/MongoDB
- 为什么文本对齐:对;工作不正常
- Javascript作用域和Ajax调用;工作不正常
- JavaScript DOM insertBefore'工作不正常
- Angular Js布线工作不正常
- onmouseout函数工作不正常
- 承诺工作不正常
- JQuery.live()工作不正常
- Alloy UI文本区域工作不正常
- ng src工作不正常,但src工作正常
- Canvas.toDataUrl(“image/png”)工作不正常
- JQuery `length`属性工作不正常.为什么?
- Javascript setInterval工作不正常
- 我的Javascript代码没有'工作不正常
- 表单验证工作不正常,在不检查条目的情况下继续
- $localStorage array select with ng选项工作不正常