{"id":5759,"date":"2025-04-02T14:55:37","date_gmt":"2025-04-02T14:55:37","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=5759"},"modified":"2025-04-02T14:57:25","modified_gmt":"2025-04-02T14:57:25","slug":"add-date-range-picker-to-input-field-using-jquery","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/","title":{"rendered":"Add Date Range Picker to Input Field using jQuery"},"content":{"rendered":"<p>The <b>Date Range Picker<\/b> allows the user to select a range of dates. You can attach the Date Range Picker component to an HTML element to pop up two calendars to select a date range. The user can select a custom date range or predefined ranges (such as &#8220;Last 7 days&#8221;, &#8220;Last 30 days&#8221;, &#8220;This month&#8221;, &#8220;Last month&#8221;, etc.) from the Date Range Picker widget.<\/p>\n<p>When Date Range Picker is attached to an input element, it creates a dropdown menu from which you can select date range and times. It very useful component when you need to allow the user to select a custom range of dates on the webpage. In this tutorial, we will show you how to <b>add a Date Range Picker to the input field using jQuery<\/b>.<\/p>\n<h2>Date Range Picker<\/h2>\n<p>We will use the Date-Range-Picker JavaScript library to add date range picker component to an HTML element.<\/p>\n<p>First, include the required libraries to use the jQuery Date Range Picker plugin.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- JS library --&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/jquery.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/moment.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\/javascript\"<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/daterangepicker.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- CSS library --&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">link<\/span> <span class=\"hljs-attr\">rel<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"stylesheet\"<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\/css\"<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"css\/daterangepicker.css\"<\/span> \/&gt;<\/span><\/pre>\n<h2>Date Range Picker Basic Functionality<\/h2>\n<p>This example code adds a basic date range picker widget to the input field.<\/p>\n<p><b>JavaScript Code:<\/b><br \/>\nThe input field name\/ID needs to be specified as date-range-picker selector.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\">$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\r\n  $(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'input[name=\"daterange\"]'<\/span>).daterangepicker({\r\n      opens: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'left'<\/span>\r\n  }, <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\">start, end, label<\/span>) <\/span>{\r\n      <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">console<\/span>.log(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"A new date selection was made: \"<\/span> + start.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'YYYY-MM-DD'<\/span>) + <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">' to '<\/span> + end.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'YYYY-MM-DD'<\/span>));\r\n  });\r\n});<\/pre>\n<p><b>HTML Code:<\/b><br \/>\nOn the input field focus, two calendar widgets will open in an overlay.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"daterange\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"01\/01\/2025 - 03\/31\/2025\"<\/span> \/&gt;<\/span><\/pre>\n<h2>Date Range Picker Advanced Functionality<\/h2>\n<p>The following examples are some advanced configuration options that can be used in jQuery Date Range Picker.<\/p>\n<p><b><u>Date Range Picker with Times<\/u><\/b><br \/>\nAttach time picker to select times along with the date range. <\/p>\n<pre style=\"color: rgb(68, 68, 68);\">$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\r\n  $(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'input[name=\"datetimes\"]'<\/span>).daterangepicker({\r\n      timePicker: <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">true<\/span>,\r\n      startDate: moment().startOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'hour'<\/span>),\r\n      endDate: moment().startOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'hour'<\/span>).add(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">72<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'hour'<\/span>),\r\n      locale: {\r\n          format: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'M\/DD hh:mm A'<\/span>\r\n      }\r\n  });\r\n});<\/pre>\n<p><u><b>Predefined Date Ranges<\/u><\/b><br \/>\nThe following example shows how to add predefined date range dropdown to select the date range automatically and put it in the input field.<\/p>\n<p>Specify the ID of the HTML element.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\">$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">var<\/span> start = moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">29<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'days'<\/span>);\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">var<\/span> end = moment();\r\n\r\n  <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span> <span class=\"hljs-title\" style=\"color: rgb(136, 0, 0); font-weight: 700;\">cb<\/span>(<span class=\"hljs-params\">start, end<\/span>) <\/span>{\r\n      $(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'#daterange span'<\/span>).html(start.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'MMMM D, YYYY'<\/span>) + <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">' - '<\/span> + end.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'MMMM D, YYYY'<\/span>));\r\n  }\r\n\r\n  $(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'#daterange'<\/span>).daterangepicker({\r\n      startDate: start,\r\n      endDate: end,\r\n      ranges: {\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Today'<\/span>: [moment(), moment()],\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Yesterday'<\/span>: [moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'days'<\/span>), moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'days'<\/span>)],\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Last 7 Days'<\/span>: [moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">6<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'days'<\/span>), moment()],\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Last 30 Days'<\/span>: [moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">29<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'days'<\/span>), moment()],\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'This Month'<\/span>: [moment().startOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>), moment().endOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>)],\r\n      <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Last Month'<\/span>: [moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>).startOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>), moment().subtract(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>).endOf(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'month'<\/span>)]\r\n      }\r\n  }, cb);\r\n\r\n  cb(start, end);\r\n});<\/pre>\n<p>Create an HTML element where the predefined date range dropdown will be embedded.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"daterange\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/pre>\n<h2>Date Range Picker Input Submission with PHP<\/h2>\n<p>In this example code, we will show you how to submit and get the selected date range values using PHP.<\/p>\n<p><b>Date Range Picker Input:<\/b><br \/>\nDefine an HTML form with an input element to submit the selected date range.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"daterange\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"01\/01\/2025 - 03\/31\/2025\"<\/span> \/&gt;<\/span><\/pre>\n<p>Attach date-range-picker to the text input field using jQuery.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\">$(<span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{\r\n  $(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'input[name=\"daterange\"]'<\/span>).daterangepicker({\r\n      opens: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'left'<\/span>\r\n  }, <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\">start, end, label<\/span>) <\/span>{\r\n      <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">console<\/span>.log(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"A new date selection was made: \"<\/span> + start.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'YYYY-MM-DD'<\/span>) + <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">' to '<\/span> + end.format(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'YYYY-MM-DD'<\/span>));\r\n  });\r\n});<\/pre>\n<p><b>Get Date Range value with PHP:<\/b><br \/>\nRetrieve date value from input field using $_POST method in PHP.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br><\/span><span style=\"color: #007700\">if(isset(<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'submit'<\/span><span style=\"color: #007700\">])){ <br>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$selected_date_range&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'daterange'<\/span><span style=\"color: #007700\">]; <br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<\/span><span style=\"color: #DD0000\">'Selected&nbsp;Date&nbsp;Range:&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$selected_date_range<\/span><span style=\"color: #007700\">; <br>} <br><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The Date Range Picker allows the user to select a range of dates. You can attach the Date Range Picker component to an HTML element to pop up two calendars to select a date range. <\/p>\n","protected":false},"author":1,"featured_media":5762,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[388,16,309],"class_list":["post-5759","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","tag-daterangepicker","tag-jquery","tag-timepicker","cat-6-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Add Date Range Picker to Input Field using jQuery - CodexWorld<\/title>\n<meta name=\"description\" content=\"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Date Range Picker to Input Field using jQuery - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-02T14:55:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-02T14:57:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Add Date Range Picker to Input Field using jQuery\",\"datePublished\":\"2025-04-02T14:55:37+00:00\",\"dateModified\":\"2025-04-02T14:57:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/\"},\"wordCount\":374,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/add-date-range-picker-to-input-field-using-jquery-codexworld.png\",\"keywords\":[\"DateRangePicker\",\"jQuery\",\"Timepicker\"],\"articleSection\":[\"jQuery\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/\",\"name\":\"Add Date Range Picker to Input Field using jQuery - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/add-date-range-picker-to-input-field-using-jquery-codexworld.png\",\"datePublished\":\"2025-04-02T14:55:37+00:00\",\"dateModified\":\"2025-04-02T14:57:25+00:00\",\"description\":\"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/add-date-range-picker-to-input-field-using-jquery-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/add-date-range-picker-to-input-field-using-jquery-codexworld.png\",\"width\":1920,\"height\":1080,\"caption\":\"add-date-range-picker-to-input-field-using-jquery-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-date-range-picker-to-input-field-using-jquery\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add Date Range Picker to Input Field using jQuery\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add Date Range Picker to Input Field using jQuery - CodexWorld","description":"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/","og_locale":"en_US","og_type":"article","og_title":"Add Date Range Picker to Input Field using jQuery - CodexWorld","og_description":"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.","og_url":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2025-04-02T14:55:37+00:00","article_modified_time":"2025-04-02T14:57:25+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Add Date Range Picker to Input Field using jQuery","datePublished":"2025-04-02T14:55:37+00:00","dateModified":"2025-04-02T14:57:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/"},"wordCount":374,"commentCount":0,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","keywords":["DateRangePicker","jQuery","Timepicker"],"articleSection":["jQuery"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/","url":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/","name":"Add Date Range Picker to Input Field using jQuery - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","datePublished":"2025-04-02T14:55:37+00:00","dateModified":"2025-04-02T14:57:25+00:00","description":"Add Date Range Picker to input field using jQuery - Use jQuery Date-Range-Picker component to add date range picker to HTML element. Example code to add date range and time range picker in the input field using jQuery.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","width":1920,"height":1080,"caption":"add-date-range-picker-to-input-field-using-jquery-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/add-date-range-picker-to-input-field-using-jquery\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Add Date Range Picker to Input Field using jQuery"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2025\/04\/add-date-range-picker-to-input-field-using-jquery-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-1uT","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=5759"}],"version-history":[{"count":2,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5759\/revisions"}],"predecessor-version":[{"id":5761,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5759\/revisions\/5761"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5762"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=5759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=5759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=5759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}