{"id":21457,"date":"2022-11-13T17:33:33","date_gmt":"2022-11-13T12:03:33","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/"},"modified":"2022-11-13T17:33:33","modified_gmt":"2022-11-13T12:03:33","slug":"solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/","title":{"rendered":"[Solved] The choice of the day is not through the select, but through the calendar"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-71778149\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"71778149\" data-parentid=\"71649398\" data-score=\"0\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>If I clearly understand you, then you need just add <code>$('#dayofweek').val(arDate[0]);<\/code> after this line <code>const arDate = e.date.toString().split(' ');<\/code>. Here is an example:<\/p>\n<\/p>\n<div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>let restaurantReserve = {\n  init: function() {\n    let _self = this;\n\n    $('#reservation-date').datepicker({\n      startDate: '+0d'\n    }).on('changeDate', function(e) {\n      const arDate = e.date.toString().split(' ');\n      $('#dayofweek').val(arDate[0]);\n      filterTimes();\n      let input = $('[name=\"RestaurantReservationForm[date]\"]');\n      input.val(arDate[3] + '-' + (e.date.getMonth() + 1) + '-' + arDate[2]);\n      _self.unSetError(input);\n      $('#reservation-date .js-value').text(arDate[2] + ' ' + arDate[1]);\n    });\n\n    $('[aria-labelledby=\"reservation-time\"] li a').click(function() {\n      $(this).closest('ul').find('a').removeClass('active');\n      $(this).addClass('active');\n      let input = $('[name=\"RestaurantReservationForm[time]\"]');\n      input.val($(this).data('value'));\n      _self.unSetError(input);\n      $('#reservation-time .js-value').text($(this).text());\n    });\n  },\n  setError: function(ob) {\n    $('#' + ob.data('btnId')).addClass('btn-error');\n  },\n  unSetError: function(ob) {\n    $('#' + ob.data('btnId')).removeClass('btn-error');\n  }\n}\nrestaurantReserve.init();\nlet json = [{\n  \"id\": 86,\n  \"restaurant_id\": 1,\n  \"day\": \"Mon\",\n  \"open\": \"9.30\",\n  \"close\": \"14.30\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 87,\n  \"restaurant_id\": 1,\n  \"day\": \"Tue\",\n  \"open\": \"3.00\",\n  \"close\": \"21.00\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 88,\n  \"restaurant_id\": 1,\n  \"day\": \"Wed\",\n  \"open\": \"4.30\",\n  \"close\": \"6.30\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 89,\n  \"restaurant_id\": 1,\n  \"day\": \"Thu\",\n  \"open\": \"2.30\",\n  \"close\": \"7.00\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 90,\n  \"restaurant_id\": 1,\n  \"day\": \"Fri\",\n  \"open\": \"3.00\",\n  \"close\": \"22.00\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, \/*{\"id\":91,\"restaurant_id\":1,\"day\":\"Sat\",\"open\":\"1.30\",\"close\":\"4.30\",\"created_at\":\"2022-02-22 10:56:15\"},*\/ {\n  \"id\": 91,\n  \"restaurant_id\": 1,\n  \"day\": \"Sat\",\n  \"open\": \"0\",\n  \"close\": \"4.30\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 92,\n  \"restaurant_id\": 1,\n  \"day\": \"Sun\",\n  \"open\": \"3.00\",\n  \"close\": \"20.30\",\n  \"created_at\": \"2022-02-22 10:56:15\"\n}, {\n  \"id\": 107,\n  \"restaurant_id\": 3,\n  \"day\": \"Mon\",\n  \"open\": \"1.30\",\n  \"close\": \"19.00\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 108,\n  \"restaurant_id\": 3,\n  \"day\": \"Tue\",\n  \"open\": \"5.30\",\n  \"close\": \"8.00\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 109,\n  \"restaurant_id\": 3,\n  \"day\": \"Wed\",\n  \"open\": \"3.00\",\n  \"close\": \"20.30\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 110,\n  \"restaurant_id\": 3,\n  \"day\": \"Thu\",\n  \"open\": \"1.00\",\n  \"close\": \"12.30\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 111,\n  \"restaurant_id\": 3,\n  \"day\": \"Fri\",\n  \"open\": \"2.30\",\n  \"close\": \"12.30\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 112,\n  \"restaurant_id\": 3,\n  \"day\": \"Sat\",\n  \"open\": \"4.00\",\n  \"close\": \"22.00\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}, {\n  \"id\": 113,\n  \"restaurant_id\": 3,\n  \"day\": \"Sun\",\n  \"open\": \"4.00\",\n  \"close\": \"22.30\",\n  \"created_at\": \"2022-02-22 10:58:59\"\n}];\n\nfunction getWorkHours(json, restaurant_id) {\n  return json.filter(item =&gt; item.restaurant_id == restaurant_id);\n}\n\nfunction getWorkHoursForDay(json, restaurant_id, day) {\n  return getWorkHours(json, restaurant_id).filter(item =&gt; item.day === day)[0];\n}\n\nfunction filterTimes() {\n  let restaurantID = document.getElementById(\"restaurantid\").value;\n  let dayofweek = document.getElementById(\"dayofweek\").value;\n  if (([\"1\", \"3\"].indexOf(restaurantID) &gt;= 0) &amp;&amp; (([\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"].indexOf(dayofweek)) &gt;= 0)) {\n    let workHours = getWorkHoursForDay(json, restaurantID, dayofweek);\n    let items = document.querySelectorAll(\".dropdown-menu.dropdown-menu-height-fixed li a\");\n    for (let item of items) {\n      let itemValueParts = item.innerText.split(\" \");\n      itemValue = parseFloat(itemValueParts[0]) + (((itemValueParts[1] === \"PM\") &amp;&amp; (itemValueParts[0] !== \"00.00\")) ? 12 : 0);\n      item.parentNode.classList[((itemValue &lt; parseFloat(workHours.open)) || (itemValue &gt; parseFloat(workHours.close)) ? \"add\" : \"remove\")](\"invisible\");\n    }\n  }\n}<\/code><\/pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.btn {\n  border: none;\n  border-radius: 8px;\n  height: 40px;\n  padding: 10px 15px;\n  font-weight: 800;\n  font-size: 14px;\n  margin-right: 10px;\n  cursor: pointer;\n}\n\n.btn-fourth {\n  text-decoration: none;\n  background: #e3e5e8;\n  color: #747b8b;\n}\n\n.invisible {\n  display: none;\n}\n\nul.with-out&gt;li:before,\n.dropdown-menu li:before,\nul.whithout&gt;li:before {\n  display: none;\n}\n\n.dropdown-menu li {\n  padding: 0;\n}\n\n.dropdown-menu-height-fixed {\n  max-height: 200px;\n  overflow-y: auto;\n}\n\n.dropdown-item.active,\n.dropdown-item:active {\n  background: red;\n}\n\n.block-shadow {\n  box-shadow: 0 2px 8px 0 rgba(32, 35, 44, 0.05);\n}\n\n.block-white {\n  background: #fff;\n  border-radius: 8px;\n  padding: 20px;\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/3.3.1\/jquery.min.js\"&gt;&lt;\/script&gt;\n&lt;link href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/bootstrap-datepicker\/1.9.0\/css\/bootstrap-datepicker.min.css\" rel=\"stylesheet\"&gt;\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/bootstrap-datepicker\/1.9.0\/js\/bootstrap-datepicker.min.js\"&gt;&lt;\/script&gt;\n&lt;form id=\"reservation\" action=\"\/restaurants\/123\/\" method=\"post\"&gt;\n  &lt;div class=\"block-shadow block-white mb-4\"&gt;\n    &lt;h5 class=\"fw-bold mb-3\"&gt;Reserve a table&lt;\/h5&gt;\n    &lt;div class=\"btn-s\"&gt;\n      &lt;a class=\"btn btn-fourth \" id=\"reservation-date\" data-date=\"&gt;\"&gt;\n        &lt;span class=\"icon br-calender\"&gt;&lt;\/span&gt; &lt;span class=\"js-value\"&gt;-----&lt;\/span&gt;\n      &lt;\/a&gt;\n      &lt;a class=\"btn btn-fourth \" id=\"reservation-time\" role=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\"&gt;\n        &lt;span class=\"icon br-clock\"&gt;&lt;\/span&gt; &lt;span class=\"js-value\"&gt;\n                        -- : --                &lt;\/span&gt;\n      &lt;\/a&gt;\n      &lt;select id=\"restaurantid\" onchange=\"filterTimes()\"&gt;\n        &lt;option&gt;Please Select Restaurant&lt;\/option&gt;\n        &lt;option value=\"1\"&gt;Pizza Mia&lt;\/option&gt;\n        &lt;option value=\"3\"&gt;Burger Land&lt;\/option&gt;\n      &lt;\/select&gt;\n      &lt;select id=\"dayofweek\" onchange=\"filterTimes()\"&gt;\n        &lt;option&gt;Please Select Day&lt;\/option&gt;\n        &lt;option value=\"Mon\"&gt;Mon&lt;\/option&gt;\n        &lt;option value=\"Tue\"&gt;Tue&lt;\/option&gt;\n        &lt;option value=\"Wed\"&gt;Wed&lt;\/option&gt;\n        &lt;option value=\"Thu\"&gt;Thu&lt;\/option&gt;\n        &lt;option value=\"Fri\"&gt;Fri&lt;\/option&gt;\n        &lt;option value=\"Sat\"&gt;Sat&lt;\/option&gt;\n        &lt;option value=\"Sun\"&gt;Sun&lt;\/option&gt;\n      &lt;\/select&gt;\n      &lt;ul class=\"dropdown-menu dropdown-menu-height-fixed\" aria-labelledby=\"reservation-time\"&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"0.00\"&gt;00.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"0.30\"&gt;00.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"1.00\"&gt;01.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"1.30\"&gt;01.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"2.00\"&gt;02.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"2.30\"&gt;02.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"3.00\"&gt;03.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"3.30\"&gt;03.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"4.00\"&gt;04.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"4.30\"&gt;04.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"5.00\"&gt;05.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"5.30\"&gt;05.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"6.00\"&gt;06.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"6.30\"&gt;06.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"7.00\"&gt;07.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"7.30\"&gt;07.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"8.00\"&gt;08.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"8.30\"&gt;08.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"9.00\"&gt;09.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"9.30\"&gt;09.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"10.00\"&gt;10.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"10.30\"&gt;10.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"11.00\"&gt;11.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"11.30\"&gt;11.30 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"12.00\"&gt;00.00 AM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"12.30\"&gt;00.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"13.00\"&gt;01.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"13.30\"&gt;01.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"14.00\"&gt;02.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"14.30\"&gt;02.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"15.00\"&gt;03.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"15.30\"&gt;03.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"16.00\"&gt;04.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"16.30\"&gt;04.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"17.00\"&gt;05.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"17.30\"&gt;05.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"18.00\"&gt;06.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"18.30\"&gt;06.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"19.00\"&gt;07.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"19.30\"&gt;07.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"20.00\"&gt;08.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"20.30\"&gt;08.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"21.00\"&gt;09.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"21.30\"&gt;09.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"22.00\"&gt;10.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"22.30\"&gt;10.30 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"23.00\"&gt;11.00 PM&lt;\/a&gt;&lt;\/li&gt;\n        &lt;li&gt;&lt;a class=\"dropdown-item \" href=\"#\" data-value=\"23.30\"&gt;11.30 PM&lt;\/a&gt;&lt;\/li&gt;\n      &lt;\/ul&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"form-group field-restaurantreservationform-personcount\"&gt;\n      &lt;input type=\"hidden\" id=\"restaurantreservationform-personcount\" class=\"form-control\" name=\"RestaurantReservationForm[personCount]\" data-btn-id=\"reservation-person\"&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"form-group field-restaurantreservationform-date required\"&gt;\n      &lt;input type=\"hidden\" id=\"restaurantreservationform-date\" class=\"form-control\" name=\"RestaurantReservationForm[date]\" data-btn-id=\"reservation-date\"&gt;\n    &lt;\/div&gt;\n    &lt;div class=\"form-group field-restaurantreservationform-time\"&gt;\n      &lt;input type=\"hidden\" id=\"restaurantreservationform-time\" class=\"form-control\" name=\"RestaurantReservationForm[time]\" data-btn-id=\"reservation-time\"&gt;\n    &lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<\/div><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">2<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved The choice of the day is not through the select, but through the calendar <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] If I clearly understand you, then you need just add $(&#8216;#dayofweek&#8217;).val(arDate[0]); after this line const arDate = e.date.toString().split(&#8216; &#8216;);. Here is an example: let restaurantReserve = { init: function() { let _self = this; $(&#8216;#reservation-date&#8217;).datepicker({ startDate: &#8216;+0d&#8217; }).on(&#8216;changeDate&#8217;, function(e) { const arDate = e.date.toString().split(&#8216; &#8216;); $(&#8216;#dayofweek&#8217;).val(arDate[0]); filterTimes(); let input = $(&#8216;[name=&#8221;RestaurantReservationForm[date]&#8221;]&#8217;); input.val(arDate[3] + &#8216;-&#8216; &#8230; <a title=\"[Solved] The choice of the day is not through the select, but through the calendar\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\" aria-label=\"More on [Solved] The choice of the day is not through the select, but through the calendar\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[346,333,388],"class_list":["post-21457","post","type-post","status-publish","format-standard","hentry","category-solved","tag-html","tag-javascript","tag-jquery"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] The choice of the day is not through the select, but through the calendar - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] The choice of the day is not through the select, but through the calendar - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] If I clearly understand you, then you need just add $(&#039;#dayofweek&#039;).val(arDate[0]); after this line const arDate = e.date.toString().split(&#039; &#039;);. Here is an example: let restaurantReserve = { init: function() { let _self = this; $(&#039;#reservation-date&#039;).datepicker({ startDate: &#039;+0d&#039; }).on(&#039;changeDate&#039;, function(e) { const arDate = e.date.toString().split(&#039; &#039;); $(&#039;#dayofweek&#039;).val(arDate[0]); filterTimes(); let input = $(&#039;[name=&quot;RestaurantReservationForm[date]&quot;]&#039;); input.val(arDate[3] + &#039;-&#039; ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-13T12:03:33+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] The choice of the day is not through the select, but through the calendar\",\"datePublished\":\"2022-11-13T12:03:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\"},\"wordCount\":49,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"html\",\"javascript\",\"jquery\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\",\"name\":\"[Solved] The choice of the day is not through the select, but through the calendar - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-11-13T12:03:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] The choice of the day is not through the select, but through the calendar\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] The choice of the day is not through the select, but through the calendar - JassWeb","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:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] The choice of the day is not through the select, but through the calendar - JassWeb","og_description":"[ad_1] If I clearly understand you, then you need just add $('#dayofweek').val(arDate[0]); after this line const arDate = e.date.toString().split(' ');. Here is an example: let restaurantReserve = { init: function() { let _self = this; $('#reservation-date').datepicker({ startDate: '+0d' }).on('changeDate', function(e) { const arDate = e.date.toString().split(' '); $('#dayofweek').val(arDate[0]); filterTimes(); let input = $('[name=\"RestaurantReservationForm[date]\"]'); input.val(arDate[3] + '-' ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/","og_site_name":"JassWeb","article_published_time":"2022-11-13T12:03:33+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] The choice of the day is not through the select, but through the calendar","datePublished":"2022-11-13T12:03:33+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/"},"wordCount":49,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["html","javascript","jquery"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/","url":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/","name":"[Solved] The choice of the day is not through the select, but through the calendar - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-11-13T12:03:33+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-the-choice-of-the-day-is-not-through-the-select-but-through-the-calendar\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] The choice of the day is not through the select, but through the calendar"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1775798750","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/21457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=21457"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/21457\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=21457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=21457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=21457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}