开发者

rails and jquery datetimepicker

Using http://trentrichardson.com/examples/timepicker/ for editing date time fields. When I click the input field, the date time picker opens correctly. The date is sele开发者_运维技巧cted, but the time is not. Time is always 00:00. How can I pass the time from the input field to the datetimepicker?

Standard form_for

<%= f.text_field :closed_date, :class => "created-at-datetime" %>

and application.js

$('.created-at-datetime').datetimepicker({dateFormat: 'yy-mm-dd ', timeFormat: 'hh:mm:ss ', ampm: false});

Renders something like this:

<input class="created-at-datetime" id="order_closed_date" name="order[closed_date]" size="30" type="text" value="2011-04-06 21:47:12.985379" />


Seems to me the time format should be all one format ie: yy-mm-dd hh:mm:ss I could be wrong but I havent seen it separated. I know if the format is not right it will not go into a database

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜