-
Notifications
You must be signed in to change notification settings - Fork 22
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
24-Hour Military Time #11
Comments
Using |
I don't think I have a way of doing that at the moment. I'd love to see that too. 👍 |
Ok, I'll fork it and work on a PR that solves this problem. I may even write a test or two. (Surprise!) |
If you get into some trouble with it, we might just want to rewrite the gem from scratch. It's probably easier to generate a select tag for both and then write a method in the controller to transform it to a Time. Seems like that would be a better solution than how this is currently designed. |
I've actually considered rewriting the gem from scratch. I think there's a simpler way to parse datetime into a combined object. I may need some help with some of the "features" but the core functionality of combining date/time together I have something up my sleeve. |
I'm open to it. Want to prototype something in a branch and we can see how to move forward? |
Yes, I'd like that. I have a few different ideas on how to simplify the gem's codebase. |
Send me a link to your branch when you've got a draft. I'm excited to see what you come up with! |
Will do. I plan to work on this sometime this weekend when I'm back. |
I still need to figure this out. I am working on an app where I need military time. Any thoughts on where I can start in the code? |
@excid3 I totally forgot about this. I forked this into a branch and am going to refactor it to accept 24:00 format. As soon as I have it working, I'll make a PR against master. What would be the best way to test this? I can write some rspec or minitest but I'm thinking of just bootstrapping a simple rails app and browser/controller testing. Thoughts? |
@excid3 after forking this branch and testing it out against different rails versions I got the 24:00 military time to work. Looks like this wasn't working in the original version which I was locked at. So I upgraded, and here's the code that gets it to work in 24:00/Military.
Looks like the labels and ampm options have to be set to false. You can close this issue. |
We should have the option in
time_select
to use military time 00:00-23:59 instead of the standard AM/PM format. I'm thinking about monkey patching this, but it would probably be best if I worked on a PR unless you've already a way to do this quickly.The text was updated successfully, but these errors were encountered: