Skip to content
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

Closed
wants to merge 2 commits into from
Closed

"Until time" input #12

wants to merge 2 commits into from

Conversation

mhchen
Copy link
Contributor

@mhchen mhchen commented May 25, 2013

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!

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.
@ghost ghost assigned forrest May 25, 2013
@nathany
Copy link
Contributor

nathany commented May 25, 2013

Thanks @mhchen. We'll try to look this over and get back to you next week.

@forrest
Copy link
Contributor

forrest commented Jun 3, 2013

I like most of this code. However, Rule.until only makes sense in some circumstances. It's actually a problem for how we use this gem in Jobber. We'll need to add some configuration options to show/hide. Should probably be a more generic configuration so devs can hide any combination of rules. Any opinion on how this should look?

@@ -10,6 +10,32 @@ def to_s
end

module RecurringSelect
class << self
attr_writer :date_format
Copy link
Contributor

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.

@forrest
Copy link
Contributor

forrest commented Jun 3, 2013

@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.

@mhchen
Copy link
Contributor Author

mhchen commented Jul 1, 2013

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.
@mhchen
Copy link
Contributor Author

mhchen commented Jul 10, 2013

@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.

@forrest
Copy link
Contributor

forrest commented Jul 26, 2013

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.

@forrest
Copy link
Contributor

forrest commented Nov 11, 2013

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

@jmulca
Copy link

jmulca commented Jan 13, 2014

+1 to getting this integrated into master

@findchris
Copy link

👍 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!

@spra85
Copy link

spra85 commented Apr 3, 2014

👍 to getting this into master too. Is the existing branch still in its infancy? Getting a javascript error when unchecking 'Repeat Indefinitely'

@nathany
Copy link
Contributor

nathany commented Apr 3, 2014

Looks like it needs a rebase with conflicts resolved.

@spra85
Copy link

spra85 commented Apr 3, 2014

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

@findchris
Copy link

Hey @mhchen and @nathany - Anything I can do to help move this pull request forward? I'd love to see this functionality merged.

Thanks.

@nathany
Copy link
Contributor

nathany commented Jul 2, 2014

@mhchen Can you merge master into your branch and resolve conflicts? Thanks

@findchris
Copy link

Thanks @nathany. If you need a hand with anything @mhchen, let me know.

@findchris
Copy link

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.

@spra85
Copy link

spra85 commented Jul 5, 2014

Let me know if I can help at all @forrest @mhchen @findchris

@findchris
Copy link

Something tells me we can't rely on @mhchen to push this forward as he seems not to be responding.

@spra85, does your fork overlap with @mhchen's work, or did you work on your own implementation of the "until time" functionality?

@spra85
Copy link

spra85 commented Jul 22, 2014

@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

@findchris
Copy link

I've almost got a pull request finished. Hopefully tomorrow I'll have the until functionality finalized.

@findchris
Copy link

New pull request created: #61

Have a look and provide any feedback. Thanks!

@forrest
Copy link
Contributor

forrest commented Jul 25, 2014

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?

@findchris
Copy link

@forrest, would you like to see that as an option to the select_recurring form helper?

@findchris
Copy link

@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 select_recurring or something more generic, like RecurringSelect.options.include_until = true. Let me know how you'd like to proceed and I can help out. (cc/ @nathany)

@nathany
Copy link
Contributor

nathany commented Sep 29, 2014

Please see #61.

@nathany nathany closed this Sep 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants