开发者

how to customize time_select helper ? Ruby On Rails

开发者 https://www.devze.com 2023-03-06 05:29 出处:网络
I am using time_select开发者_StackOverflow中文版 helper on a site that has Right-To-Left Text ().

I am using time_select开发者_StackOverflow中文版 helper on a site that has Right-To-Left Text ().

Therefore the time_select turns over in the html output (The hour select is before the minute select).

How can I make the minute select be before the hour select?

Thanks,

Oded


unlike the date_select, time_select doesn't have an order option unfortunately.

What you could do:

  1. use select_hour and select_minute to customize it
  2. use time_select and do a CSS trick and apply float: left; (or maybe float: right;) to the minute select field, you can identify the minute select by the id which looks like objectname_fieldname_5i so if you call time_select('myobject', 'myfield') the id is myobject_myfield_5i
0

精彩评论

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