frustrating error. not readily discern answer stack overflow hence resorting posting question. appreciated.
i"m getting error:
uncaught typeerror: $(...).datepicker not function
- rails 4.2.4
- ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
gemfile:
gem 'ransack' gem 'bootstrap-sass', '~> 3.2.0' gem 'autoprefixer-rails' gem 'momentjs-rails', '>= 2.9.0' gem 'bootstrap3-datetimepicker-rails', '~> 4.14.30'
my application.js file:
//= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require datatables/jquery.datatables //= require turbolinks //= require jquery-ui/autocomplete //= require autocomplete-rails //= require bootstrap-sprockets //= require moment //= require bootstrap-datetimepicker //= require_tree .
my application.css.sass file:
@import "bootstrap-sprockets" @import "bootstrap" @import 'bootstrap-datetimepicker'
this how selecting date picker (within document ready):
$('#date-form-control1').datepicker({format: 'yyyy-mm-dd'});
this form:
<div class="field"> <%= f.label :invoice_invoice_date_gteq, "date: greater than:" %> <%= f.text_field :invoice_invoice_date_gteq, id: "date-form-control1", placeholder: "date >= to" %> </div>
any advice appreciated.
you can't call datetimepicker datepicker({mindate})
use $('#date-form-control1').datetimepicker();
if want use date use datepicker
Comments
Post a Comment