概述:用在rails平臺下的日期選擇插件
我的環(huán)境:ruby1.8.6 + rails 2.1.0 + windows
預覽:
使用方法:
1,安裝插件
gem install calendar_date_select
2,在environment.rb 中添加
config.gem "calendar_date_select"
3,restart你的服務器
4,在rhtml中使用
<%= calendar_date_select_includes "silver",:locale=>'zh' # or "blue", or "silver", or nil for the default! <%= form_tag :action=>'new' %> |
另外可以中文化,格式化等等...........
中文化:
在public的對應文件夾下的local下添加zh.js
Date.weekdays = $w("一 二 三 四 五 六 七"); Date.first_day_of_week = 1 _translations = { |
格式化:
在environment.rb最后添加
CalendarDateSelect.format = :iso_date |
源碼下載:
http://www.namipan.com/d/d8ebbc8dda4c1aac18add209401fe1f2ccd67b4572b70100
ref:
http://code.google.com/p/calendardateselect/
http://code.google.com/p/calendardateselect/wiki/HowToLocalize
http://code.google.com/p/calendardateselect/wiki/ChangingDateFormat
write by feng |