2015-11-23 139 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

領域

希望它有幫助!