This library takes a time window time frame like "Monday-Thursday 9am-11am", and a array of rules about advancing dates ["start now", "advance 2 days", "advance 4 days", "advance 1 week"]
and returns datetimes.
Add this line to your application's Gemfile:
gem 'advance_a_few_days'
And then execute:
$ bundle
Or install it yourself as:
$ gem install advance_a_few_days
advance_rules = ["start now", "advance 2 days", "advance 4 days", "advance 1 week"]
window_rules = {
days: "Monday:Tuesday:Wednesday:Thursday",
start_time: "9:00",
end_time: "11:00",
}
AdvanceAFewDays.create_days(window_rules, advance_rules, Time.now, 'Eastern Time (US & Canada)')
OR
startdate_time = 3.days.from_now # a Rails sugar thing
AdvanceAFewDays.create_days(window_rules, advance_rules, startdate_time)
- Fork it ( https://github.com/[my-github-username]/advance_a_few_days/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request