2015-11-23 94 views
0

我有一个Rails4应用程序使用gem 'bootstrap-sass'。我正在使用引导日期选择器。Rails 4 Bootstrap DatePicker类今天不工作

这是JavaScript:

$(".datepicker").datepicker 
    autoclose: true 
    format: "yyyy-mm-dd" 
    orientation: "left top" 

这是视图代码:

<%= f.input :shoot_date, :as => :string, :label => 'Shoot Date:', :input_html => {:class => 'datepicker'}, :wrapper_html => {:style => 'width: 250px'} %> 

但是,今天的日期是不突出。在HTML,它应该有:

<td class="day today">23</td> 

但它是:

<td class="day">23</td> 

today丢失。

我在做什么错?由于

PS - 我不想默认为今天的日期 - 只是它强调在日历上

+0

哪个引导日期选择器你在使用请给链接 – uday

回答

1

假设你正在使用这个自举日期选择器,https://github.com/eternicode/bootstrap-datepicker

你应该做这样的事情:

$('.my-datepicker-class').datepicker({ todayHighlight: true});

todayHighlight是你必须设置为true

领域

希望它有帮助!