Skip to content

Conversation

@faburem
Copy link

@faburem faburem commented Jun 23, 2015

check if the next[0] occurrence is defined before processing it further

@fcarreiro
Copy link

Hi @bunkat , this lib is great work!
However ( :) ) I'm running into trouble when using one-off times, I think it may be related to this fix.

const later = require('later')
const sc = later.parse.recur()
  .on(new Date('2017-06-15T15:00:00Z')).fullDate().and()
  .on(new Date('2017-06-16T15:00:00Z')).fullDate()
console.log(later.schedule(sc).next(10))

yields

/home/app/backend/node_modules/later/later.js:777
        return !b || a.getTime() > b.getTime();
                       ^

TypeError: a.getTime is not a function
    at /home/app/backend/node_modules/later/later.js:777:24
    at findNext (/home/app/backend/node_modules/later/later.js:785:23)
    at getInstances (/home/app/backend/node_modules/later/later.js:637:52)
    at Object.next (/home/app/backend/node_modules/later/later.js:796:16)

Comments? @faburem

@faburem
Copy link
Author

faburem commented Jun 14, 2017

That is exactly the issue I was running into. Unfortunately my pull request still hasn't been merged. I'm using my fork in production for quite a while now and didn't encounter any problems yet.

@niftylettuce
Copy link

Per my work with Bree, I have an updated fork of this package called @breejs/later. See https://github.com/breejs/later if you would like to file this PR there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants