I have a problem here. How do i run job at certain date time in the future using Agenda like node-scheduler do. Based on https://www.npmjs.com/package/node-schedule, node-schedule have cron-style scheduling method. So it is easier for me to extract date from my input. I have read Agenda documentation https://github.com/rschmukler/agenda#agenda-events, it says Agenda uses Human Interval for specifying the intervals.
How can i do this?
If you have a future date, you can convert this to number of
days
from today or even number ofseconds
as below and then use the same withagenda
cron jobThen create
agenda
job and schedule it withdaysFromNow
calculated above,If you want to schedule it at particular time in the future, you can calculate the seconds as below,
Then create
agenda
job and schedule it withsecsFromNow
calculated above,