1.1.3 • Published 8 years ago

next-moment v1.1.3

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

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.