-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeating monthly by day of week - include 5th week and LAST in UI #66
Conversation
Thanks for looking into this omission Naomi. I'm curious what the behaviour is when choosing 5th week of the month if the next month is only 4 weeks long? I've yet to test it out. The test failures appear to be some unrelated sprockets thing. Sorry about that. We'll get that fixed in an independent pull request. |
Reading through the Ice cube docs briefly I think if a month doesn't have a 5th monday an event is just not created for that month. I'd have to double check that though. |
That would be consistent with what I've seen for schedules like the 30th of the month. February just gets skipped. |
If you merge master into your branch, the tests are passing now. |
@naomiaro Just shared this with our customer support and sales teams at Jobber. They said we've never had a request for 5th week and find the addition a bit confusing. Perhaps it could be configurable? I'm not sure what others using recurring_select would like to see. Possibly some would like 4 weeks + last week without the 5th week row. |
Yes, configuring what to display would be good. To make it the most general I think I'd want to try to do some kind of matrix (if I was doing this for myself) week x day of week, so that perhaps businesses maybe wanting to use this calendar could display it without certain days of the week (sunday/saturday) or I know of businesses always closed on the 2nd and 4th monday of a month. Not sure if this would be too much for the project though, maybe just configuring the 5th week could be fine. |
I think two options to configure the visibility of the 4th/5th and last week would be sufficient for now. The default could be the current behaviour, with some info in the REAMDE to enable the options. Whether or not to make weekends available could be another option, but that can come later. |
OK, sounds good to me. |
Including changes to make the build pass
…Hiding 5th and Last week by default to match current functionality.
I've merged the upstream changes and provided some configurable defaults to show the weeks (updated the README as well.) Default functionality should be what the widget currently shows (4 weeks) |
Thanks Naomi. I'm not sure about doing the |
Oh right, yes that would be way better. $.fn.recurring_select.options currently doesn't exist correct? I should create that.. maybe under options.monthly.week.show_week? |
How about |
…Hiding 5th and Last week by default to match current functionality.
Conflicts: README.md app/assets/javascripts/recurring_select_dialog.js.coffee.erb
I've put those changes in the branch now |
Thanks Naomi. I'm not in love with the true, true, false, false way of configuring this. But I'm not sure how to do it better. Let's go with this for now. |
Now I see where you were going with |
Yeah just thought it might be good to scope to each widget pane |
Feel free to open a new pull request if you come up with a cleaner way to configure the options. :-) |
currently there's only the possibility of choosing week 1-4 in the UI, losing some functionality from the ice cube library this way.
-every month on the first and last tuesdays of the month
schedule.add_recurrence_rule Rule.monthly.day_of_week(:tuesday => [1, -1])