wvega / timepicker

A jQuery plugin to enhance standard form input fields helping users to select (or type) times
http://timepicker.co
GNU General Public License v2.0
216 stars 93 forks source link

Let users know they also need JQuery 2.X plugin for Timepicker to work #84

Open govindrai opened 8 years ago

govindrai commented 8 years ago

Although this seems very amatuer (and I am), I didn't know you needed both JQuery and JQueryUI for the plugin to work, I wasted a solid 45 minutes trying to figure out what the issue was. On your website you mention:

To use jQuery Timepicker you'll need to include two files: jquery.timepicker.min.js and jquery.timepicker.min.css. Then, assuming you have an element in your document, with class timepicker, you can use the code on the right (or the code below, if you are reading on mobile) to initialize the plugin.

It would be awesome if you added or modified sentence i.e., To use...you'll need to include the two files... as well as JQuery and JQueryUI.

I think this will help noobs save headaches (I for one had JQuery in my file but was missing JQuery UI so it would have been very helpful to know!)

Thanks!

wvega commented 8 years ago

Hi @govindrai, I'm sorry you had problems setting up the plugin.

jQuery UI should be optional. Here is a demo that works using just the CSS and JavaScript from the plugin: http://jsfiddle.net/wvega/Cas6T/embedded/result,js,html,css,resources/.

What were the problems you had before including jQuery UI in your project?

govindrai commented 7 years ago

Hi @wvega, thank's for your speedy reply. You're correct about JQuery UI being optional. Maybe it was some other error in my code. However, it wasn't clear to me that I also need jQuery for the plugin to work (yes I am a noob). However, at the end of the day, and this is just my suggestion, clarification is never bad. :)

To use jQuery Timepicker you'll need to include two files: jquery.timepicker.min.js and jquery.timepicker.min.css. Then, assuming you have jQuery 2.X and have an element in your document, with class timepicker, you can use the code on the right (or the code below, if you are reading on mobile) to initialize the plugin.

Also I was reusing your plugin today and encountered errors with jQuery 3.X, hence the "jQuery 2.X" in the suggestion above.