0

The gems i'm using are twitter-bootstrap-rails and jquery-rails.

Basically what I'm, trying to do is set the minDate on the date picker however none of the options are being accepted.

$(selector).datepicker minDate: 0

Weirdly enough when I do a .on on the datepicker 'changeDate' works.

Any ideas?

EDIT: I just figured out that jquery-ui isn't being loaded with the page. I guess this means I am using the bootstrap datepicker, which I thought needed the jqueryui library, however no matter what I did I couldn't get the site to load jqueryui?

eytanfb
  • 443
  • 4
  • 17
  • Can you paste your code and check if there are any errors in web console? – Ermin Dedovic Jun 12 '13 at 22:41
  • The code works when I have no options for datepicker. that's why i guessed that there was a problem with the options – eytanfb Jun 12 '13 at 22:44
  • Are you using this datepicker http://www.eyecon.ro/bootstrap-datepicker/ ? It doesn't have minDate option... – Ermin Dedovic Jun 12 '13 at 22:54
  • the only gems i'm using are the ones mentioned above. actually that might be the problem. i am not the original author of the code but i'm assuming the datepicker comes from the jquery-rails gem, which should have minDate. i tried added the gem you mentioned and used startDate to do the same thing to no avail – eytanfb Jun 12 '13 at 22:58
  • Are you sure you are not using jQueryUI? jQuery itself doesn't have datepicker control. Can you try this http://jqueryui.com/datepicker/#min-max ? – Ermin Dedovic Jun 12 '13 at 23:03
  • i know that but i checked the application.js file and there was a reference to jquery-ui so yes i think its jqueryUI datepicker. however minDate doesn't work either way. – eytanfb Jun 12 '13 at 23:10
  • Like this? $(selector).datepicker({ minDate: 0 }); – Ermin Dedovic Jun 12 '13 at 23:18
  • Exactly but in coffeescript – eytanfb Jun 12 '13 at 23:21
  • Do you get any errors in web console? – Ermin Dedovic Jun 12 '13 at 23:26
  • I just checked it on CoffeeConsole and no it doesn't give any error syntactically – eytanfb Jun 13 '13 at 02:22

1 Answers1

0

It turns out the downloaded version of bootstra-datepicker wasn't the latest version. I got the latest version on GitHub. Gotta be careful next time!

eytanfb
  • 443
  • 4
  • 17