{"id":2550,"date":"2022-08-30T15:25:48","date_gmt":"2022-08-30T15:25:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/31\/how-to-correctly-implement-jquery-datepicker-and-jquery-time-picker-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:48","modified_gmt":"2022-08-30T15:25:48","slug":"how-to-correctly-implement-jquery-datepicker-and-jquery-time-picker-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-correctly-implement-jquery-datepicker-and-jquery-time-picker-collection-of-common-programming-errors\/","title":{"rendered":"How to correctly implement jQuery datepicker and jQuery time picker-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to install datepicker UI on my application along with its cool addon Timepicker http:\/\/trentrichardson.com\/examples\/timepicker\/#basic_examples<\/p>\n<p>I keep getting this error in the console<\/p>\n<pre><code>Uncaught TypeError: undefined is not a function jquery.ui.widget.js:71\n$.widget jquery.ui.widget.js:71\n(anonymous function) jquery.ui.slider.js:22\n(anonymous function) jquery.ui.slider.js:672\n<\/code><\/pre>\n<p>I am trying to use example #3 which is a datepicker plus a slider (time format)<\/p>\n<pre><code>$('#basic_example_3').datetimepicker({\n    timeFormat: \"hh:mm tt\"\n});\n<\/code><\/pre>\n<p>Here is what I my head html code<\/p>\n<pre><code>  \n  \n  \n  \n  \n  \n  \n<\/code><\/pre>\n<p>I don&#8217;t see a slider at all in my calender pop up. I see a drop down menu with time! Can some one help me with this please? I think if I can fix that error it will solve the problem.<\/p>\n<p>Thanks<\/p>\n<ol>\n<li>\n<p>Regarding the source of the example page I would suggest trying this setup:<\/p>\n<pre><code>\n\n\n\n<\/code><\/pre>\n<p>Edit: Created a fiddle for you: http:\/\/jsfiddle.net\/sNa8d\/<\/p>\n<\/li>\n<li>\n<p>if you want to use <code>datepicker<\/code> + <code>timepicker<\/code> and you have only one input to post them you can combine <code>datepicker<\/code> and <code>timepicker<\/code> on submit function like below:<\/p>\n<h3>Jquery<\/h3>\n<pre><code>$(\"form\").submit(function () {\n\n     var matchStr = $('#matchStartDate').val() + ' ' +$('#matchStartTime').val();\n     $('#MatchStartTime').val(matchStr);\n\n     return true;\n  });\n<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>\n\n<\/code><\/pre>\n<h3>For posting with MVC<\/h3>\n<pre><code> @Html.HiddenFor(m =&gt; m.MatchStartTime)\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-31 08:04:27. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am trying to install datepicker UI on my application along with its cool addon Timepicker http:\/\/trentrichardson.com\/examples\/timepicker\/#basic_examples I keep getting this error in the console Uncaught TypeError: undefined is not a function jquery.ui.widget.js:71 $.widget jquery.ui.widget.js:71 (anonymous function) jquery.ui.slider.js:22 (anonymous function) jquery.ui.slider.js:672 I am trying to use example #3 which is a datepicker plus a slider [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2550","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2550"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2550\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}