What about datetime? |
[eluser]Colin Williams[/eluser]
Shouldn't your post, perhaps, outline what this helper would do? ;-P There are myriad ways to implement date input controls on web forms. What method should a core form_datetime helper implement, and why this specific one? Interested to hear where you're going with this.
[eluser]Unknown[/eluser]
Sorry about that Colin Actually I'm coming from a Rails background and there a method that formats datetime in a HTML form, As in the following image maybe? [Image: http://i33.tinypic.com/34ora1j.jpg] and Why? because It's better to improve the rest of the application instead of implementing such a thing ![]() ref: http://api.rubyonrails.com/classes/Actio...elper.html
[eluser]Bramme[/eluser]
Now you're making sense :p Must say I quite approve of this. However, formatting this back to an actual datetime string (or unix timestamp for those who prefer it) would require an addition to the input library as well... Unless you'd put a helper in the form helper as well to format the selects into a datetime stamp.
[eluser]nevercraft[/eluser]
I wrote a similar function to do date dropdowns. I've expanded it for the time as well. Code: if (! function_exists('form_datetime_dropdown')) And to get a datetime string for use with mysql: Code: $start_raw = $this->input->post('start'); I'd imagine there are a lot of different ways to do this though, depending on how your db is setup and how you want the forms to look. You might want to use AM/PM time, or add timezones, etc. It might be tough to cover every scenario in the core. |
Welcome Guest, Not a member yet? Register Sign In |