This is a paid project. I'll accept answers in
Ruby, Elixir, or NodeJS. Or all 3.
- I need the project done by Saturday, February 27th.
- DONE
I'll pay $500 for the Ruby answer. - And $250 for an Elixir or Node answer.
# Before starting, please email me at:
e = "dGJyb29rc0BnbWFpbC5jb20="
Base64.decode64(e)
Write a method/function that will calculate an array of DateTimes that fall into the date/time window specified and have a moved forward by a minimum of the advance rules.
- Monday-Thursday 9am-11am
- start now
- advance 2 days
- advance 4 days
- advance 1 week
Time should advance by some positive integer and either days, weeks, or months.
e.g. Let's say the date is Saturday, February 20, 2016. And you want a result array that follows the rules above.
A correct result would be:
$irb> create_days(window_rules, advance_rules)
$irb> => [2016-02-22 09:11:53, 2016-02-24 10:14:53, 2016-02-29 09:38:00, 2016-03-07 09:11:53]
# Because the first date (now) is on a Saturday, `create_days`
# chooses the next available time within the window_rules
# or Monday, Feb. 22nd.
The solution should also take into account:
window inputs could be:
- Monday, Wednesday 10am-10pm
- Tuesday-Thursday, Sunday 8am-4pm
advance inputs could be:
- [start now (regardless of whether "now" falls in the window), advance 2 days, advance 1 month, etc..]
are you passing in the window_rules and advance rules, "in english"? as in the ruby method signature is
create_days("Monday-Thursday 9am-11am", ["start now", "advance 2 days", "advance 4 days", "advance 1 week"])
?