-
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
"Until time" input #12
Conversation
Add an extra input that takes a date in user-specified format that can be specified using RecurringSelect.date_format= (defaults to :db format %Y-%m-%d). Add jQuery UI as a dependency for the datepicker.
Thanks @mhchen. We'll try to look this over and get back to you next week. |
I like most of this code. However, |
@@ -10,6 +10,32 @@ def to_s | |||
end | |||
|
|||
module RecurringSelect | |||
class << self | |||
attr_writer :date_format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not going to be thread safe. Any multi-tenant applications with different date formats will be a problem.
I would recommend sending in the date-format as an option to the widget. The widget can then display the date in the required format for the form. It can have bind to change
and send back the epoch seconds as an integer or the full time in ISO-8601 format. This will avoid storing a class variable.
@mhchen if you can re-write the date format stuff to be thread safe, I'll come up with a system for managing which options are visible and merge it all together. Thanks again for the hard work. I know it's not easy picking up open-source code and diving in like this. |
Hi @forrest, sorry I've been MIA. Had a major deadline for my full-time job. Will try and take another look at the issue this week. Thanks for the tips and the encouragement. |
The format can be passed as the :until_datepicker_format option on the form helper or a data-until-datepicker-format html option. The until_time will be passed between the server and frontend using the unix timestamp.
@forrest this is a lot more code than I wanted to change to get this feature working, so please let me know if you can see any other way to reduce the footprint for it. Also, I'd be happy to help with the configuration issue (allowing users to disable the features they don't need/can't have for their project) you were referring to earlier. If you'd like me to help with the design or do any of the legwork for it just let me know. |
Hey @mhchen, sorry I haven't got to this sooner. The updates slipped through the cracks for me. Will try to get to it in the next week. |
Hey, I'm still working on getting this into an approach I'm happy with, but I wanted to let you know that I've been keeping it up to date with other changes on the until_time_input branch. https://github.com/GetJobber/recurring_select/tree/until_time_input |
+1 to getting this integrated into master |
👍 Great stuff. I look at Google Calendar's recurring interface as sufficiently thorough, and I see "until" functionality as one of the only major differences between that and this gem. The only other one that comes to mind is the ability to provide a hint to the recurrence UI: For example, if I choose a start/end on Wednesday, the recurrence UI preselects Wednesday as the weekly recurrence rule. Thanks for the contribution! |
👍 to getting this into master too. Is the existing branch still in its infancy? Getting a javascript error when unchecking 'Repeat Indefinitely' |
Looks like it needs a rebase with conflicts resolved. |
We figured out the data until-datepicker-format, which got rid of the Repeat Indefinitely JS error. We found and fixed an issue with the until time not being converted to unix integer time when being used by the helper, and merged master into a fork of the branch. https://github.com/spra85/recurring_select/compare/until_time_input |
@mhchen Can you merge master into your branch and resolve conflicts? Thanks |
Hey @forrest, is the work that @spra85 did (see #12 (comment)) a merge-able alternative to what @mhchen had been working on? He seems to have picked up where @mhchen had left off. |
Let me know if I can help at all @forrest @mhchen @findchris |
@findchris I didn't really change any of the underlying implementation, just rebased what had become a huge difference to try to get it merged in |
I've almost got a pull request finished. Hopefully tomorrow I'll have the until functionality finalized. |
New pull request created: #61 Have a look and provide any feedback. Thanks! |
We don't actually want this piece of functionality in our system. I don't mind merging it in if you make it configurable, so that we can choose not to display this field? |
@forrest, would you like to see that as an option to the |
@forrest, you previously wrote "I'll come up with a system for managing which options are visible and merge it all together." What had you envisioned for the configuration? I imagine it's got to be either an option to |
Please see #61. |
Hey guys, thanks for this awesome tool, it really has taken a lot of the headache out of managing recurring events. I had to make use IceCube::Rule's until/until_time feature recently, so I added this functionality to the recurring_select. It accepts a configuration parameter for the date format, and to make things easier I added jQuery UI (datepicker only) as a dependency, but I would be happy to switch to using Chronic or some other simpler gem to handle the date format/parsing. Let me know if you'd like to include this and what direction (if any) you'd like to go with the dependencies so I can update the documentation as well!