概述:用在rails平台下的日期选择插件
 我的环境: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' %>日期:<%= calendar_date_select_tag "regdate", nil, :popup => "force" %><br/>
 <%= submit_tag '注册'  %>
 <%= form_tag %>
 | 
 另外可以中文化,格式化等等...........
 中文化:
 在public的对应文件夹下的local下添加zh.js
    | Date.weekdays = $w("一 二 三 四 五 六 七");Date.months = $w("一月 二月 三月 四月 五月 六月 七月 八月 九月 十月 十一月 十二月" );
 Date.first_day_of_week = 1   _translations = {"OK": "确定",
 "Now": "现在",
 "Today": "今天",
 "Clear": "清除"
 }
 | 
  
 格式化:
 在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
	posted on 2009-04-08 17:48 
fl1429 阅读(610) 
评论(0)  编辑  收藏  所属分类: 
Rails