如何从标题中删除设备日历中的事件?

时间:2016-02-04 07:29:21

标签: angularjs calendar ionic-framework

我正在研究离子应用。我想使用event title从设备日历中删除事件?我知道使用window.plugins.calendar.deleteEvent()方法,但

  1. 我可以使用它仅按标题删除事件吗?
  2. 是否有任何删除日历中所有事件的方法 有特别的头衔吗?
  3. 覆盖以前设备日历事件的最佳方法是什么。
  4. 以下是我的代码

            var createEventSuccess = function () {
              alert('Job added to calendar:'+job.id);
            }
            var createEventError = function (error) {
              alert('Error adding Job to calendar : ' + error);
            }
    
            var deleteEventSuccess = function () {
                alert('Event Deleted:'+job.id);
                window.plugins.calendar.createEventWithOptions(title, location, job.services, scheduledTime, scheduledTime, calOptions, createEventSuccess, createEventError);
            }
    
            var deleteEventError = function (error) {
                alert('Problem in Deleting:'+error);
            }
    
            var findEventSuccess = function () {
                alert('Event found');
                window.plugins.calendar.deleteEvent(title, null, null, null, null, deleteEventSuccess, deleteEventError);
            }
    
            var findEventError = function (error) {
                alert('Event not found : ' + error);
                window.plugins.calendar.createEventWithOptions(title, location, job.services, scheduledTime, scheduledTime, calOptions, createEventSuccess, createEventError);
            }
    
            window.plugins.calendar.findEvent(title, null, null, null, null, findEventSuccess, findEventError)
    

    我不想依赖其他字段,因为字段可能会因标题而改变,所以我只想通过使用标题来查找或删除作业。

    我在google上搜索过但没有找到与我的要求相关的文档。

    请帮助..

    感谢。

1 个答案:

答案 0 :(得分:1)

plugin's Site上说:

<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>

<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Modal Header</h4>
      </div>
      <div class="modal-body">
        <h1>Image sort</h1>
<div class="packery">
  <div class="item w2 h2 i1" tabindex="0">A</div>
  <div class="item w2 h2 i2" tabindex="1">B</div>
  <div class="item w2 h2 i3" tabindex="2">C</div>
  <div class="item w2 h2 i4" tabindex="3">D</div>
  <div class="item w2 h2 i5" tabindex="4">E</div>
</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>

日期是必填项,代表删除活动的日期范围。