Rails datetime with single textbox for date and time drop downs -


I have a Rail Form, which has Dateline input

I have a single text box I would like to create that user will input in the MM / DD / YYYY format (or through jQuery's datecocker) and then the time input will be based on the 12-hour point spreading downwards. I found this plug-in - - to handle the part of the 12 hour time, but I'm not sure how to make a text box (and only date).

I could convert this text to multiple text boxes instead of several drop-downs through this plugin -

I want to do it with at least controller logic so if its name It is possible in such areas that the railways who know how to add them, which will be ideal.

In the field of a text you can do this only by a JavaScript mask, in the input field of the date Build hidden areas with each part.

If you want to use Javascript anyway, use it to select date or trust for a user to input the date in a specified format, both scenarios will give you a formatted string , So that you can easily parse it

  # params [: date_as_str] = "2010/07/29 10:00 AM" object.date = DateTime.strptime (params [: date_as_str] , "% Y /% m /% d% H:% M% p")  

You can do javascript on a text field Create custom assistants to create a "mask" of T


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -