bunkat / later

A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
http://bunkat.github.io/later/
MIT License
2.42k stars 245 forks source link

how to cancel the schedule event #200

Closed yidingdian closed 5 years ago

yidingdian commented 7 years ago

Hi, I use later to trigger my events,

var sched = later.parse.recur().on(new Date(event.starttime)).fullDate(),
      t = later.setTimeout(function, sched)

I know calling clear would cancel the event t.clear()

Now I met a problem. I had many specific times to schedule, such as ‘ 2017-02-17T03:05:23Z, 2017-02-17T07:05:23Z, 2017-02-18T04:05:23Z ... ’ then there was a request to cancel one of the schedules, '2017-02-17T07:05:23Z'. I couldn't get the instance 't', how could I cancel the event?

Thanks in advance for your help!

yidingdian commented 5 years ago

I had use 'agenda' replace 'later' to resolve that.