{"id":413006,"date":"2023-11-27T09:31:55","date_gmt":"2023-11-27T09:31:55","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=413006"},"modified":"2024-03-13T13:16:42","modified_gmt":"2024-03-13T13:16:42","slug":"how-to-create-a-time-picker-in-hyva-hyva-timepicker","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/","title":{"rendered":"How to create a time picker in Hyva || Hyva Timepicker"},"content":{"rendered":"\n<p>Hello Readers !!<br><br>Today, I am going to drive you through the way of creating a custom time picker for Hyva-compatible <a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 extensions<\/a>. Specifically, I created this time picker to make it compatible with the values provided by the Magento 2 default time picker widget. Without further wasting time let&#8217;s head over to the code!<\/p>\n\n\n\n<p>Initialize the &#8220;timepicker&#8221; component by a div covering your input text field.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;div x-data=&quot;timepicker()&quot;&gt;\n    &lt;div class=&quot;control&quot;&gt;\n        &lt;input type=&quot;text&quot;\n         @click=&quot;showTimepicker = true;&quot;\n         x-model=&quot;timeSelected&quot;\n         name=&quot;start_time&quot;\n         id=&quot;start_time&quot;\n    &lt;\/div&gt;\n    &lt;!-- Add timepicker html here --&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<p>Here is the time picker html which you have to add after the input field, though it has a good clean UI, you are free to make changes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;div class=&quot;bg-white border-2 rounded-lg shadow p-4&quot;\n    @keydown.escape=&quot;closeTimePicker()&quot;\n    @click.away=&quot;closeTimePicker()&quot;\n    style=&quot;width: 17rem; position: absolute;&quot;\n    x-show.transition=&quot;showTimepicker&quot;&gt;\n    &lt;div class=&quot;mb-4&quot;&gt;\n        &lt;div class=&quot;flex flex-row justify-center items-center&quot;&gt;\n            &lt;div class=&quot;flex flex-col items-center mx-2&quot;&gt;\n                &lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;\n                @click=&quot;increaseHour&quot; fill=&quot;none&quot;\n                viewBox=&quot;0 0 24 24&quot;\n                stroke-width=&quot;1.5&quot; stroke=&quot;currentColor&quot;\n                class=&quot;w-6 h-6 opacity-0 hover:opacity-100 \n                transition-all duration-200 ease-&#091;ease] \n                cursor-pointer&quot;&gt;\n                    &lt;path stroke-linecap=&quot;round&quot;\n                        stroke-linejoin=&quot;round&quot; \n                        d=&quot;M4.5 15.75l7.5-7.5 7.5 7.5&quot; \/&gt;\n                &lt;\/svg&gt;\n                &lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;\n                @click=&quot;decreaseHour&quot; fill=&quot;none&quot;\n                viewBox=&quot;0 0 24 24&quot;\n                stroke-width=&quot;1.5&quot; stroke=&quot;currentColor&quot;\n                class=&quot;w-6 h-6 opacity-0 hover:opacity-100 \n                transition-all duration-200 ease-&#091;ease] \n                cursor-pointer&quot;&gt;\n                    &lt;path stroke-linecap=&quot;round&quot;\n                    stroke-linejoin=&quot;round&quot;\n                    d=&quot;M19.5 8.25l-7.5 7.5-7.5-7.5&quot; \/&gt;\n                &lt;\/svg&gt;\n            &lt;\/div&gt;\n            &lt;span x-text=&quot;hour.padStart(2, &#039;0&#039;)&quot;\n            class=&quot;text-lg font-bold text-gray-800 mx-2&quot;&gt;&lt;\/span&gt;\n            &lt;span class=&quot;mx-1 text-lg text-gray-600 font-bold mx-2&quot;&gt;\n                 &lt;? =$escaper-&gt;escapeHtml(&#039;:&#039;)?&gt;&lt;\/span&gt;\n            &lt;span x-text=&quot;minute.padStart(2, &#039;0&#039;)&quot;\n            class=&quot;text-lg font-bold text-gray-800 mx-2&quot;&gt;&lt;\/span&gt;\n            &lt;div class=&quot;flex flex-col items-center mx-2&quot;&gt;\n                &lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;\n                @click=&quot;increaseMinute&quot; fill=&quot;none&quot;\n                viewBox=&quot;0 0 24 24&quot;\n                stroke-width=&quot;1.5&quot; stroke=&quot;currentColor&quot;\n                class=&quot;w-6 h-6 opacity-0 hover:opacity-100 \n                transition-all duration-200 ease-&#091;ease]\n                cursor-pointer&quot;&gt;\n                    &lt;path stroke-linecap=&quot;round&quot;\n                    stroke-linejoin=&quot;round&quot;\n                    d=&quot;M4.5 15.75l7.5-7.5 7.5 7.5&quot; \/&gt;\n                &lt;\/svg&gt;\n                &lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot;\n                @click=&quot;decreaseMinute&quot; fill=&quot;none&quot;\n                viewBox=&quot;0 0 24 24&quot;\n                stroke-width=&quot;1.5&quot;\n                stroke=&quot;currentColor&quot;\n                class=&quot;w-6 h-6 opacity-0 hover:opacity-100 \n                transition-all duration-200 ease-&#091;ease] \n                cursor-pointer&quot;&gt;\n                    &lt;path stroke-linecap=&quot;round&quot;\n                    stroke-linejoin=&quot;round&quot;\n                    d=&quot;M19.5 8.25l-7.5 7.5-7.5-7.5&quot; \/&gt;\n                &lt;\/svg&gt;\n            &lt;\/div&gt;\n        &lt;\/div&gt;\n        &lt;div class=&quot;flex flex-row justify-center item-center&quot;&gt;\n            &lt;button @click.prevent=&quot;period = &#039;AM&#039;; setTime();&quot;\n            class=&quot;bg-slate-200 hover:bg-slate-300 \n            active:bg-slate-500 rounded \n            focus:outline-none focus:ring \n            focus:ring-slate-100 mr-2 p-1&quot;&gt;\n               &lt;?=$escaper-&gt;escapeHtml(&#039;AM&#039;)?&gt;\n            &lt;\/button&gt;\n            &lt;button @click.prevent=&quot;period = &#039;PM&#039;; setTime();&quot;\n            class=&quot;bg-slate-200 hover:bg-slate-300 \n            active:bg-slate-500 rounded\n            focus:outline-none focus:ring \n            focus:ring-slate-100 ml-2 p-1&quot;&gt;\n               &lt;?=$escaper-&gt;escapeHtml(&#039;PM&#039;)?&gt;\n            &lt;\/button&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n    &lt;div class=&quot;flex flex-row justify-between item-center px-4&quot;&gt;\n        &lt;button @click.prevent=&quot;setCurrenTime&quot;\n        class=&quot;btn btn-secondary&quot;&gt;&lt;?=$escaper-&gt;escapeHtml(&#039;NOW&#039;)?&gt;&lt;\/button&gt;\n        &lt;button @click.prevent=&quot;closeTimePicker&quot;\n        class=&quot;btn btn-secondary&quot;&gt;&lt;?=$escaper-&gt;escapeHtml(&#039;OK&#039;)?&gt;&lt;\/button&gt;\n    &lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<p>After adding the above HTML content you have to add this script to the page where you want to use the time picker, it is an Alpine Js component for time picker functionalities.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\n&lt;script&gt;\n    function timepicker(format, timeString)\n    {\n        return {\n            hour: &quot;01&quot;,\n            minute: &quot;00&quot;,\n            showTimepicker: false,\n            period: &quot;&quot;,\n            format: &quot;12h&quot;,\n            timeSelected: &quot;&quot;,\n            init(){\n                if(format == &quot;12h&quot; &amp;&amp; timeString != &quot;&quot;){\n                    let hour = Number(timeString.match(\/^(\\d+)\/)&#091;1]);\n                    let minute = Number(timeString.match(\/:(\\d+)\/)&#091;1]);\n                    let period = timeString.match(\/\\s(.*)$\/)&#091;1];\n                    this.initTime(hour, minute, period, format);\n                }\n            },\n            initTime(hour, minute, period, format){\n                const now = new Date();\n                this.hour = hour ?? now.getHours();\n                this.minute = minute ?? now.getMinutes();\n                this.period = period ?? this.period;\n                this.format = format ?? this.format;\n                let timeObj = this.formatTime(\n                    this.format,\n                    parseInt(this.hour),\n                    parseInt(this.minute),\n                    this.period\n                );\n                this.hour = timeObj?.hour.toString().padStart(2, &#039;0&#039;);\n                this.minute = timeObj?.minute.toString().padStart(2, &#039;0&#039;);\n                this.period = timeObj?.period.toString().padStart(2, &#039;0&#039;);\n                this.setTime();\n            },\n            setTime(timeObj){\n                this.timeSelected = \n                `${this.hour.toString().padStart(2, &#039;0&#039;)}:`+\n                `${this.minute.toString().padStart(2, &#039;0&#039;)}`+\n                `${this.period}`;\n            },\n            setCurrenTime(){\n                this.initTime(null, null, null, &quot;12h&quot;);\n            },\n            increaseHour(){\n                let hour = parseInt(this.hour);\n                if(hour &gt;= 12){\n                    hour = 01;\n                } else {\n                    hour++;\n                }\n                this.hour = hour.toString();\n            },\n            decreaseHour(){\n                let hour = parseInt(this.hour);\n                if(hour &lt;= 1){\n                    hour = 12;\n                } else {\n                    hour--;\n                }\n                this.hour = hour.toString();\n            },\n            increaseMinute(){\n                let minute = parseInt(this.minute);\n                if(minute &gt;= 59){\n                    minute = 00;\n                } else {\n                    minute++;\n                }\n                this.minute = minute.toString();\n            },\n            decreaseMinute(){\n                let minute = parseInt(this.minute);\n                if(minute &lt;= 0){\n                    minute = 59;\n                } else {\n                    minute--;\n                }\n                this.minute = minute.toString();\n            },\n            formatTime(format, hour, min, period){\n                hour = parseInt(hour);\n                min = parseInt(min);\n                if(format == &quot;12h&quot;){\n                    if(hour &gt;= 12){\n                        hour = (hour % 12) || 12;\n                        period = &quot;PM&quot;;\n                    }\n                }\n                if(format == &quot;24h&quot;){\n                    if (period == &quot;PM&quot; &amp;&amp; hour &lt; 12) hour = hour + 12;\n                    if (period == &quot;AM&quot; &amp;&amp; hour == 12) hour = hour - 12;\n                    period = &quot;&quot;;\n                }\n                return \n                {hour: hour, minute: min, period: period, format: format};\n            },\n            closeTimePicker(){\n                this.setTime();\n                this.showTimepicker = false;\n            }\n        }\n    }\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>Your time picker will look like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1200x675.png\" alt=\"timepicker\" class=\"wp-image-413027\" style=\"width:819px;height:auto\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1200x675.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-300x169.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-250x141.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-768x432.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1536x864.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44.png 1600w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>That&#8217;s it! <br><br>You are good to go for using this time picker and you can make modifications according to your needs.<br><br>Hope You Like it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Readers !! Today, I am going to drive you through the way of creating a custom time picker for Hyva-compatible Magento 2 extensions. Specifically, I created this time picker to make it compatible with the values provided by the Magento 2 default time picker widget. Without further wasting time let&#8217;s head over to the <a href=\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":473,"featured_media":413030,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[15187,15186,12664,15182,2056,2070,13578,15185,15184,15183,15181,590],"class_list":["post-413006","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-alpinejs","tag-datetimepicker-hyva","tag-hyva","tag-hyva-timepicker","tag-magento","tag-magento2","tag-tailwindcss","tag-time-input-hyva","tag-time-input","tag-time-widget","tag-timepicker","tag-webkul"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog<\/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:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Hello Readers !! Today, I am going to drive you through the way of creating a custom time picker for Hyva-compatible Magento 2 extensions. Specifically, I created this time picker to make it compatible with the values provided by the Magento 2 default time picker widget. Without further wasting time let&#8217;s head over to the [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-27T09:31:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-13T13:16:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mohd. Faizan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mohd. Faizan\" \/>\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:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\"},\"author\":{\"name\":\"Mohd. Faizan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c942913229700415ddc81738a8d8c80\"},\"headline\":\"How to create a time picker in Hyva || Hyva Timepicker\",\"datePublished\":\"2023-11-27T09:31:55+00:00\",\"dateModified\":\"2024-03-13T13:16:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\"},\"wordCount\":168,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png\",\"keywords\":[\"AlpineJs\",\"datetimepicker hyva\",\"hyva\",\"hyva-timepicker\",\"magento\",\"Magento2\",\"TailwindCss\",\"time input hyva\",\"time-input\",\"time-widget\",\"timepicker\",\"webkul\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\",\"name\":\"How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png\",\"datePublished\":\"2023-11-27T09:31:55+00:00\",\"dateModified\":\"2024-03-13T13:16:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png\",\"width\":1600,\"height\":900,\"caption\":\"Screenshot-from-2023-11-27-13-13-44-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create a time picker in Hyva || Hyva Timepicker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c942913229700415ddc81738a8d8c80\",\"name\":\"Mohd. Faizan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/72aacab989e7eb0f9393bed2de5086bae41b6406e7d5c5f4b4511dcf25d7d420?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/72aacab989e7eb0f9393bed2de5086bae41b6406e7d5c5f4b4511dcf25d7d420?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Mohd. Faizan\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/mohd-faizan900\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog","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:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/","og_locale":"en_US","og_type":"article","og_title":"How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog","og_description":"Hello Readers !! Today, I am going to drive you through the way of creating a custom time picker for Hyva-compatible Magento 2 extensions. Specifically, I created this time picker to make it compatible with the values provided by the Magento 2 default time picker widget. Without further wasting time let&#8217;s head over to the [...]","og_url":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-11-27T09:31:55+00:00","article_modified_time":"2024-03-13T13:16:42+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png","type":"image\/png"}],"author":"Mohd. Faizan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Mohd. Faizan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/"},"author":{"name":"Mohd. Faizan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c942913229700415ddc81738a8d8c80"},"headline":"How to create a time picker in Hyva || Hyva Timepicker","datePublished":"2023-11-27T09:31:55+00:00","dateModified":"2024-03-13T13:16:42+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/"},"wordCount":168,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png","keywords":["AlpineJs","datetimepicker hyva","hyva","hyva-timepicker","magento","Magento2","TailwindCss","time input hyva","time-input","time-widget","timepicker","webkul"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/","url":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/","name":"How to create a time picker in Hyva || Hyva Timepicker - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png","datePublished":"2023-11-27T09:31:55+00:00","dateModified":"2024-03-13T13:16:42+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/Screenshot-from-2023-11-27-13-13-44-1.png","width":1600,"height":900,"caption":"Screenshot-from-2023-11-27-13-13-44-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-create-a-time-picker-in-hyva-hyva-timepicker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to create a time picker in Hyva || Hyva Timepicker"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/1c942913229700415ddc81738a8d8c80","name":"Mohd. Faizan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/72aacab989e7eb0f9393bed2de5086bae41b6406e7d5c5f4b4511dcf25d7d420?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/72aacab989e7eb0f9393bed2de5086bae41b6406e7d5c5f4b4511dcf25d7d420?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Mohd. Faizan"},"url":"https:\/\/webkul.com\/blog\/author\/mohd-faizan900\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/413006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/473"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=413006"}],"version-history":[{"count":11,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/413006\/revisions"}],"predecessor-version":[{"id":422189,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/413006\/revisions\/422189"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/413030"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=413006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=413006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=413006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}