2015-08-17 66 views
2

我正在使用rails 3作爲人力資源應用程序,爲了向中東客戶提供訪問權限,我使用Hijri(伊斯蘭)日曆自定義了我的應用程序。Rails簡單形式Hijri(Ismalic日曆)日曆

但在員工的編輯選項,我使用默認的simple_form功能與此代碼 <%= f.input :iqidate,end_year: Date.today.year,start_year:1960 %>

但是,這是在公曆生成的默認生成的下拉

。我想知道我應該調整這個函數來生成伊斯蘭日曆。

回答

0

你正在處理的日期字段只是Ruby日期庫,所以我會建議使用Ruby庫將日期轉換爲ruby中的hijri。這個stackoverflow帖子可能會幫助挑選正確的:https://stackoverflow.com/questions/3569827/is-there-any-hijri-date-library-in-ruby

+1

謝謝Kelseydh,我試過了,但沒有運氣。我安裝了https://github.com/stormvirux/hijri2greg_date gem,並試過這段代碼<%= f.input:iqidate,end_year:Date.today.to_hijri.year,start_year:1960%>,但它給出了錯誤,可能你幫我在哪裏我應該做這個轉換。我需要在窗體中生成伊斯蘭日曆html下拉菜單 – Talha