Skip to content

billiam13s/next-moment

Repository files navigation

Build Status Coverage Status

next moment is use for calculate the next sequence of timed event from basic config object. (ie: calendar repeat event, repeat schedule tasks)

  • minutely
  • hourly
  • daily
  • weekly
  • monthly
start = moment();
options = {
    repeat: "minutely|hourly|daily|weekly|monthly",
    interval: 1, //
    end_at: moment|date, //optional, no repeat beyond this date
}

// optional weekly options
// options.days_week = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]

// monthly options
// options.monthly_repeat_by: "day_of_month|day_of_week"

// optional monthly option
// options.stick_to_last_day = true // stick to the end of the month

nm = new NextMoment(start, options);
nm.getNext();

nm.getNext(); // second next reoccurring date

TODO

  1. yearly

License

Apache 2.0 license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published