{"id":34623,"date":"2022-10-14T17:13:52","date_gmt":"2022-10-14T15:13:52","guid":{"rendered":"https:\/\/lacolmenatecnologica.com\/elementor-academy-temas\/fix-first-day-of-the-week-formatting-and-calendar-translation-of-the-date-type-field-of-the-elementor-pro-form-widget\/"},"modified":"2023-03-30T12:10:56","modified_gmt":"2023-03-30T10:10:56","slug":"fix-first-day-of-the-week-formatting-and-calendar-translation-of-the-date-type-field-of-the-elementor-pro-form-widget","status":"publish","type":"elementor-adedemy","link":"https:\/\/lacolmenatecnologica.com\/en\/elementor-academy-temas\/fix-first-day-of-the-week-formatting-and-calendar-translation-of-the-date-type-field-of-the-elementor-pro-form-widget\/","title":{"rendered":"Fix first day of the week, formatting and calendar translation of the Date type field of the Elementor Pro Form widget."},"content":{"rendered":"\n<p>In this topic we are going to see how to fix through JavaScript code, the problem of the calendar displayed in the date field of the Elementor Pro Form widget.<\/p>\n\n<figure class=\"wp-block-image alignright size-full is-resized\"><a href=\"https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&quality=92&webp=92&avif=92&w=2560\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&quality=92&webp=92&avif=92\" alt=\"Elementor Pro Form widget calendar\" class=\"wp-image-18519\" width=\"561\" height=\"337\" srcset=\"https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&amp;quality=92&amp;webp=92&amp;avif=92 689w, https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro-300x180.jpg?strip=all&amp;quality=92&amp;webp=92&amp;avif=92 300w, https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&amp;quality=92&amp;webp=92&amp;avif=92&amp;w=137 137w, https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&amp;quality=92&amp;webp=92&amp;avif=92&amp;w=413 413w, https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/calendario-widget-form-de-elementor-pro.jpg?strip=all&amp;quality=92&amp;webp=92&amp;avif=92&amp;w=551 551w\" sizes=\"(max-width: 561px) 100vw, 561px\" \/><\/a><\/figure>\n<ol class=\"wp-block-list\"><li>The first problem arises because North American calendars continue to use <strong>Sunday as the first day of<\/strong> the week, while European calendars consider Monday as the first day.<\/li><li>The second problem is that in this calendar the<strong> months and days of the week are in English<\/strong>.<\/li><li>And the third problem is that when we select a date in the calendar it returns it in <strong>American date format Y-m-d<\/strong> (Year-month-day).<\/li><\/ol>\n<p>Elementor Pro uses the JavaScript <a rel=\"noreferrer noopener\" href=\"https:\/\/flatpickr.js.org\/\" target=\"_blank\">Flatpickr<\/a> library to implement a <strong>datepicker<\/strong> that facilitates the date section through a calendar, by default this library is in English, sets Sunday as the first day of the week and returns the date with amarican format.  <\/p>\n\n<h2 class=\"wp-block-heading\">What is a datepicker?<\/h2>\n\n<p><em>Datepikers<\/em> are elements that help the user to select a date in a simple way through a visual calendar.<\/p>\n\n<h2 class=\"wp-block-heading\">What is Flatpickr?<\/h2>\n\n<p><strong>Flatpickr<\/strong> is a library dedicated to the creation of datepickers that does not depend on <strong>JQuery UI Datepicker<\/strong>, is lighter and is the one used by Elementor Pro to improve the selection of dates in the date fields of the Form widget.<\/p>\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n<p>Let&#8217;s see how to insert the code in our website.<\/p>\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-el-calendario-del-campo-fecha-del-formulario-elementor-form.gif?strip=all&quality=92&webp=92&avif=92&w=2560\"><img decoding=\"async\" width=\"1614\" height=\"908\" src=\"https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-el-calendario-del-campo-fecha-del-formulario-elementor-form.gif?strip=all&quality=92&webp=92&avif=92&resize=1614%2C908\" alt=\"Insert custom code in Elementor\" class=\"wp-image-18546\"\/><\/a><\/figure>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"33236\" class=\"elementor elementor-33236 elementor-18521\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3f303c8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3f303c8\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;jet_parallax_layout_list&quot;:[]}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-01880a1\" data-id=\"01880a1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a6c5376 elementor-align-left elementor-widget elementor-widget-dce-copy-to-clipboard\" data-id=\"a6c5376\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;dce_clipboard_type&quot;:&quot;code&quot;,&quot;dce_clipboard_visible&quot;:&quot;yes&quot;,&quot;animation_on_copy&quot;:&quot;shake-animation&quot;}\" data-widget_type=\"dce-copy-to-clipboard.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\n\t\t<div class=\"dce-clipboard-wrapper dce-clipboard-wrapper-code\">\n\t\t\t\t\t<button class=\"elementor-button elementor-size-sm\" type=\"button\" id=\"dce-clipboard-btn-1\" data-clipboard-text=\"&lt;script&gt;\n   jQuery(document).ready(function($){\n     flatpickr.l10ns.default.firstDayOfWeek = 1; \/\/ Establecer primer d\u00eda lunes\n\t\t flatpickr.l10ns.default.weekdays = {\n            shorthand: [ &#039;Dom&#039;, &#039;Lun&#039;, &#039;Mar&#039;, &#039;Mie&#039;, &#039;Jue&#039;, &#039;Vie&#039;, &#039;Sab&#039; ],\n            longhand : [ &#039;Domingo&#039;, &#039;Lunes&#039;, &#039;Martes&#039;, &#039;Mi\u00e9rcoles&#039;, &#039;Jueves&#039;, &#039;Viernes&#039;, &#039;S\u00e1bado&#039;]\n     };\n\t\t flatpickr.l10ns.default.months = {\n            shorthand: [ &#039;Ene&#039;, &#039;Feb&#039;, &#039;Mar&#039;, &#039;Abr&#039;, &#039;May&#039;, &#039;Jun&#039;, &#039;Jul&#039;, &#039;Ago&#039;, &#039;Sep&#039;, &#039;Oct&#039;, &#039;Nov&#039;, &#039;Dic&#039; ],\n            longhand : [ &#039;Enero&#039;, &#039;Febrero&#039;, &#039;Marzo&#039;, &#039;Abril&#039;, &#039;Mayo&#039;, &#039;Junio&#039;, &#039;Julio&#039;, &#039;Agosto&#039;, &#039;Septiembre&#039;, &#039;Octubre&#039;, &#039;Noviembre&#039;, &#039;Diciembre&#039; ]\n     };\n\t\tsetTimeout( function(){\n\t\t\t    $(&#039;.elementor-date-field&#039;).each(function(){flatpickr( $(this)[0] ).set(&#039;dateFormat&#039;, &#039;d\/m\/Y&#039;);});\n\t\t}, 1000 );\n   });\n&lt;\/script&gt;\">\n\t\t\t<span class=\"elementor-button-content-wrapper dce-flexbox\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-icon elementor-align-icon-left\">\n\t\t\t\t\t\t<i aria-hidden=\"true\" class=\"far fa-copy\"><\/i>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Copy code<\/span>\n\t\t\t<\/span>\n\t\t<\/button>\n\t\t\t\t<pre class=\"dce-clipboard-code line-numbers\"><code class=\"language-javascript\">&lt;script&gt;\n   jQuery(document).ready(function($){\n     flatpickr.l10ns.default.firstDayOfWeek = 1; \/\/ Establecer primer d\u00eda lunes\n\t\t flatpickr.l10ns.default.weekdays = {\n            shorthand: [ &#039;Dom&#039;, &#039;Lun&#039;, &#039;Mar&#039;, &#039;Mie&#039;, &#039;Jue&#039;, &#039;Vie&#039;, &#039;Sab&#039; ],\n            longhand : [ &#039;Domingo&#039;, &#039;Lunes&#039;, &#039;Martes&#039;, &#039;Mi\u00e9rcoles&#039;, &#039;Jueves&#039;, &#039;Viernes&#039;, &#039;S\u00e1bado&#039;]\n     };\n\t\t flatpickr.l10ns.default.months = {\n            shorthand: [ &#039;Ene&#039;, &#039;Feb&#039;, &#039;Mar&#039;, &#039;Abr&#039;, &#039;May&#039;, &#039;Jun&#039;, &#039;Jul&#039;, &#039;Ago&#039;, &#039;Sep&#039;, &#039;Oct&#039;, &#039;Nov&#039;, &#039;Dic&#039; ],\n            longhand : [ &#039;Enero&#039;, &#039;Febrero&#039;, &#039;Marzo&#039;, &#039;Abril&#039;, &#039;Mayo&#039;, &#039;Junio&#039;, &#039;Julio&#039;, &#039;Agosto&#039;, &#039;Septiembre&#039;, &#039;Octubre&#039;, &#039;Noviembre&#039;, &#039;Diciembre&#039; ]\n     };\n\t\tsetTimeout( function(){\n\t\t\t    $(&#039;.elementor-date-field&#039;).each(function(){flatpickr( $(this)[0] ).set(&#039;dateFormat&#039;, &#039;d\/m\/Y&#039;);});\n\t\t}, 1000 );\n   });\n&lt;\/script&gt;<\/code><\/pre>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n\n<ol class=\"wp-block-list\"><li>Click on the <strong>COPY CODE<\/strong> button above.<\/li><li>In the WordPress admin panel navigate to <em>Elementor<\/em> &gt; <em>Custom Code<\/em>.<\/li><li>Click on the <strong>Add new<\/strong> button.<\/li><li>Type a title and paste the code into the box below using <strong>CTRL+V<\/strong> (Windows) or <strong>CMD+V<\/strong> (Mac). You can also right-click and select <em>Paste<\/em>.<\/li><li>Click on the <strong>Publish<\/strong> button.<\/li><li>In the pop-up window set the <a href=\"https:\/\/lacolmenatecnologica.com\/elementor-academy-temas\/condiciones-de-visualizacion-para-plantillas-globales-del-maquetador-de-temas\/\">display conditions<\/a>, by default <strong>All site<\/strong>.<\/li><li>Click on <strong>Save &amp; Close<\/strong>.<\/li><\/ol>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Now the calendar in the Date field will be displayed correctly.<\/p><\/blockquote>\n","protected":false},"featured_media":32925,"template":"","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"class_list":["post-34623","elementor-adedemy","type-elementor-adedemy","status-publish","has-post-thumbnail","hentry"],"uagb_featured_image_src":{"full":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro.jpg?strip=all&quality=92&webp=92&avif=92",1921,948,false],"thumbnail":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro-150x150.jpg?strip=all&quality=92&webp=92&avif=92",150,150,true],"medium":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro-300x148.jpg?strip=all&quality=92&webp=92&avif=92",300,148,true],"medium_large":["https:\/\/lacolmenatecnologica.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro-768x379.jpg",768,379,true],"large":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro.jpg?strip=all&quality=92&webp=92&avif=92&fit=1920%2C948",1920,948,true],"1536x1536":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro-1536x758.jpg?strip=all&quality=92&webp=92&avif=92",1536,758,true],"2048x2048":["https:\/\/e6xg7yg7k87.exactdn.com\/wp-content\/uploads\/2022\/10\/corregir-calendario-del-campo-fecha-del-widget-form-de-elementor-pro.jpg?strip=all&quality=92&webp=92&avif=92",1921,948,true]},"uagb_author_info":{"display_name":"La Colmena Tecnol\u00f3gica","author_link":"https:\/\/lacolmenatecnologica.com\/en\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"In this topic we are going to see how to fix through JavaScript code, the problem of the calendar displayed in the date field of the Elementor Pro Form widget. The first problem arises because North American calendars continue to use Sunday as the first day of the week, while European calendars consider Monday as&hellip;","_links":{"self":[{"href":"https:\/\/lacolmenatecnologica.com\/en\/wp-json\/wp\/v2\/elementor-adedemy\/34623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lacolmenatecnologica.com\/en\/wp-json\/wp\/v2\/elementor-adedemy"}],"about":[{"href":"https:\/\/lacolmenatecnologica.com\/en\/wp-json\/wp\/v2\/types\/elementor-adedemy"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lacolmenatecnologica.com\/en\/wp-json\/wp\/v2\/media\/32925"}],"wp:attachment":[{"href":"https:\/\/lacolmenatecnologica.com\/en\/wp-json\/wp\/v2\/media?parent=34623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}