2016-07-25 36 views
0

我有simple_form輸入,它需要輸入datetime。如何刪除simple_form中的日期時間分隔符?

= f.input :input, as: :datetime, start_year: DateTime.now.year, label: false, selected: DateTime.now 

該代碼正在工作,但日期和時間之間有分隔符。格式看起來像這樣。

"%d %B %Y-%H:%M" 

我該怎麼做,所以格式會是這樣?

"%d %B %Y %H:%M" 

我試過this solution,但沒有什麼變化。

使用this solution方法代碼:

= f.input :input, as: :datetime, date_separator: '', time_separator: '', start_year: DateTime.now.year, label: false, selected: DateTime.now 

回答

0

魔術選項:datetime_separator: ""