TrevorS / bootstrap3-datetimepicker-rails

This gem packages the bootstrap-datetimepicker for the Rails 3.1+ asset pipeline.
MIT License
292 stars 123 forks source link

disabledDates refuses to work #21

Closed JackWells closed 9 years ago

JackWells commented 9 years ago

I forked the jsfiddle, and it works ok here: http://jsfiddle.net/JackWells/dd49ys79/2/

I forked your git (the time-false demo) and it does not work: https://github.com/JackWells/bs3dp-test

What I did with the git:

  1. Ran "rake rails:update:bin"
  2. Ran "bundle install"
  3. Changed app/assets/javascripts/test.js by copying exactly what is in the fiddle:
    $(function() {
      $('#datetimepicker').datetimepicker({
      pickTime: false,
      defaultDate: "10/25/2014",
      disabledDates: [
          "10/27/2014 00:53",
          "10/28/2014 00:53"
      ]});
    });

The "pickTime: false" works. The disabledDates does not. Yet it works in the jsFiddle. How can this be?

Edit: Took out '//= require bootstrap-datetimepicker' and put the 'bootstrap-datetimepicker.js ', referenced in the fiddle, in the tree. No change.

Added moment.js, referenced in the fiddle, to the js folder, removed require_tree, and manually required each js file, in order. No change.

TrevorS commented 9 years ago

Very strange, I'll take a look and see if I can figure out what's going on. Thanks!

JackWells commented 9 years ago

I ran another test this morning. I pushed the forked-git to Heroku, with the same result (disabled dates are not disabled). I believe this rules out some undefined weirdness on my dev-machine.

TrevorS commented 9 years ago

Updated to 4.0.0 will you check to see if you have similar issues and reopen if so?