Note that there are some explanatory texts on larger screens.

plurals
  1. POTimepicker not working on rails app
    text
    copied!<p>So, If you've used date picker then you'll know how it works - when you click on the field that date picker is associated with a calendar box will pop up with jquery and allow the user to choose a date.</p> <p>Basically, this isn't happening with my time picker, time field. It just acts as a text_field and no time picker box pops up for a user to choose a time. Datepicker works perfectly fine, but I'm not sure why Timepicker isn't as I've never used it before.</p> <p>I've downloaded the library, and required it in the .js and .css files, what am I doing wrong?</p> <p>event.js.coffee</p> <pre><code>jQuery -&gt; if $('#event_date').length &gt; 0 $('#event_date').datepicker &lt;---datepicker which works format: 'yyyy-mm-dd' $('#event_time').timepicker({ 'scrollDefaultNow': true }); &lt;--- time picker which doesn't work </code></pre> <p>form.html.rb</p> <pre><code>File Edit Options Tools Rinari nXhtml Buffers Services Help &lt;%= simple_form_for @event do |f| %&gt; &lt;h5&gt;Event title:&lt;/h5&gt; &lt;div&gt;&lt;%= f.input_field :title, placeholder: "Event title", required: true, autocomplete: :off %&gt;&lt;/div&gt; &lt;h5&gt;Event description:&lt;/h5&gt; &lt;div&gt;&lt;%= f.input_field :description, placeholder: "Event description", required: true, autocomplete: :off %&gt;&lt;/div&gt; &lt;h5&gt;Event date:&lt;/h5&gt; &lt;div&gt;&lt;%= f.text_field :date %&gt;&lt;/div&gt; &lt;---datepicker which works &lt;div&gt;&lt;%= f.text_field :time, id: "event_time" %&gt;&lt;/div&gt; &lt;--- time picker which doesn't work &lt;h5&gt;Event location:&lt;/h5&gt; &lt;div&gt;&lt;%= f.input_field :location, placeholder: "Event location", required: true, autocomplete: :off %&gt;&lt;/div&gt; &lt;div&gt;&lt;%= f.submit @event.new_record? ? "Create event" : "Update event" %&gt;&lt;/div&gt;&lt;br /&gt; &lt;% end %&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload