setting minDate in datepicker in Rails
- by Sakshi Jain
I need to apply minDate attribute to the datepicker in Rails App.
In _admin_controls.html.erb
<%= f.input :end_date, wrapper: :append do %>
<div id="datepicker" class="datepicker input-group edit-left">
<%= f.text_field :end_date, :class => "datetime form-control" %>
application.js contains
jQuery(document).on('focus', 'input.datetime', function() {
opts = {format: 'M dd, yyyy', autoclose: true};
jQuery(this).datepicker(opts);
jQuery(".datepicker").css("z-index",10000);
});
What should be the javascript to do so only for _admin_controls.html.erb?