Closed psychoslave closed 5 years ago
Hi,
Can you show me how you are creating the input?
I tried this two in my erb:
<input type="text" data-provide='datepicker' >
<div class="input-group date">
<input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
and in the js:
$('.input-group.date').datepicker({
startDate: "11/6/2018",
endDate: "11/12/2018",
maxViewMode: 1,
language: "fr",
autoclose: true,
datesDisabled: ['06/06/2018', '06/21/2018']
});
No js for the first, as from my understanding it should work automatically with the `data-provide='datepicker'``.
Hi!
Sorry for the wait :) Did you figure out what was wrong? I would think the datepicker() needs to be called on the input.
Hi @psychoslave , my datepicker doesn't work either
But I found the issue was due to using a custom theme, and the theme overrides the dropdown-menu and somoe other styles, hence the widget didn't show up, hope that give you a direction to find out the bug.
Hi,
I'm running a Rails 5.1.6 application and tried to install datepicker, but I failed to make it work.
I did changed the Gemfile as required, and updated
app/assets/stylesheets/application.scss
(not the css one which we don't use) andapp/assets/javascripts/application.js
as documented. When I add an input, it just stay as if nothing would happen to them.The application seems well installed, and putting a
debugger
before calling$('.input-group.date').datepicker
enable to see that the following function is called:I don't have much idea to debug it further though. Neither rails nor browser console don't throw any error.
Let me know if I can provide any further relevant information.