{"id":28355,"date":"2024-03-16T10:11:44","date_gmt":"2024-03-16T10:11:44","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/"},"modified":"2024-03-22T13:15:32","modified_gmt":"2024-03-22T13:15:32","slug":"how-can-the-default-value-be-set-in-wdatepicker","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/","title":{"rendered":"How can the default value be set in wdatepicker?"},"content":{"rendered":"<p>To set the default value of wdatepicker, you can use the following method:<\/p>\n<ol>\n<li>Add the following code to the tag:<\/li>\n<\/ol>\n<pre class=\"hljs\"><code>&lt;script&gt;\r\n    <span class=\"hljs-variable language_\">window<\/span>.<span class=\"hljs-property\">onload<\/span> = <span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\"><\/span>) {\r\n        wdatepicker.<span class=\"hljs-title function_\">setValue<\/span>(<span class=\"hljs-string\">&quot;2022-01-01&quot;<\/span>); <span class=\"hljs-comment\">\/\/ Set the default date to January 1, 2022<\/span>\r\n    };\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li>Use HTML&#8217;s data attribute to set the default value. For example, add the data-default-date attribute to the <input> tag to set the default date:<\/li>\n<\/ol>\n<pre class=\"hljs\"><code><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">&quot;text&quot;<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">&quot;Wdate&quot;<\/span> <span class=\"hljs-attr\">data-default-date<\/span>=<span class=\"hljs-string\">&quot;2022-01-01&quot;<\/span>&gt;<\/span>\r\n<\/code><\/pre>\n<p>Then, when initializing wdatepicker, you can set the default date by reading the value of the data-default-date attribute:<\/p>\n<pre class=\"hljs\"><code>&lt;script&gt;\r\n    <span class=\"hljs-variable language_\">window<\/span>.<span class=\"hljs-property\">onload<\/span> = <span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\"><\/span>) {\r\n        <span class=\"hljs-keyword\">var<\/span> defaultDate = <span class=\"hljs-variable language_\">document<\/span>.<span class=\"hljs-title function_\">querySelector<\/span>(<span class=\"hljs-string\">&quot;.Wdate&quot;<\/span>).<span class=\"hljs-title function_\">getAttribute<\/span>(<span class=\"hljs-string\">&quot;data-default-date&quot;<\/span>);\r\n        wdatepicker.<span class=\"hljs-title function_\">setValue<\/span>(defaultDate);\r\n    };\r\n&lt;\/script&gt;\r\n<\/code><\/pre>\n<p>Both of these methods can be used to set the default value of wdatepicker based on requirements.<\/p>\n<\/li>\n<li>1. Can you please sum up the main points of the presentation for me?<\/li>\n<li>&#8220;Il n&#8217;y a pas de fum\u00e9e sans feu.&#8221;\n<p>There&#8217;s no smoke without fire.<\/li>\n<li>Please summarize the passage in your own words.<\/li>\n<li>&#8220;It&#8217;s not uncommon for people to feel anxious before giving a presentation.&#8221;\n<p>&#8220;It&#8217;s normal for individuals to experience nervousness before presenting.&#8221;<\/li>\n<li>Can you please give me some advice on how to improve my resume?<\/li>\n<li>The code above initializes two functions in JavaScript: the first function inserts a script tag to load a specific script from a Baidu domain, and sets up a hover effect on elements with a class of &#8220;fifth_ic&#8221;. The second function sets up tracking for Union360 by inserting a script tag with the relevant source URL.<\/li>\n<li>I don&#8217;t think that&#8217;s a good idea.<\/li>\n<li>Can you please tell me what time it is?<\/li>\n<li>Initialize syntax highlighting on load.<\/li>\n<li>When the document has finished loading, select all &#8216;pre&#8217; elements and highlight them using the hljs library.<\/li>\n<li>Set the variable &#8220;page_position&#8221; to &#8216;detail&#8217;, then call functions parseInLinks() and getDetailQuantities().<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>To set the default value of wdatepicker, you can use the following method: Add the following code to the tag: &lt;script&gt; window.onload = function() { wdatepicker.setValue(&quot;2022-01-01&quot;); \/\/ Set the default date to January 1, 2022 }; &lt;\/script&gt; Use HTML&#8217;s data attribute to set the default value. For example, add the data-default-date attribute to the tag [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-28355","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How can the default value be set in wdatepicker? - Blog - Silicon Cloud<\/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:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How can the default value be set in wdatepicker?\" \/>\n<meta property=\"og:description\" content=\"To set the default value of wdatepicker, you can use the following method: Add the following code to the tag: &lt;script&gt; window.onload = function() { wdatepicker.setValue(&quot;2022-01-01&quot;); \/\/ Set the default date to January 1, 2022 }; &lt;\/script&gt; Use HTML&#8217;s data attribute to set the default value. For example, add the data-default-date attribute to the tag [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-16T10:11:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-22T13:15:32+00:00\" \/>\n<meta name=\"author\" content=\"Noah Thompson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Noah Thompson\" \/>\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.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\"},\"author\":{\"name\":\"Noah Thompson\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\"},\"headline\":\"How can the default value be set in wdatepicker?\",\"datePublished\":\"2024-03-16T10:11:44+00:00\",\"dateModified\":\"2024-03-22T13:15:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\"},\"wordCount\":270,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\",\"name\":\"How can the default value be set in wdatepicker? - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-16T10:11:44+00:00\",\"dateModified\":\"2024-03-22T13:15:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How can the default value be set in wdatepicker?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\",\"name\":\"Noah Thompson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"caption\":\"Noah Thompson\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How can the default value be set in wdatepicker? - Blog - Silicon Cloud","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.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/","og_locale":"en_US","og_type":"article","og_title":"How can the default value be set in wdatepicker?","og_description":"To set the default value of wdatepicker, you can use the following method: Add the following code to the tag: &lt;script&gt; window.onload = function() { wdatepicker.setValue(&quot;2022-01-01&quot;); \/\/ Set the default date to January 1, 2022 }; &lt;\/script&gt; Use HTML&#8217;s data attribute to set the default value. For example, add the data-default-date attribute to the tag [&hellip;]","og_url":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-16T10:11:44+00:00","article_modified_time":"2024-03-22T13:15:32+00:00","author":"Noah Thompson","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Noah Thompson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/"},"author":{"name":"Noah Thompson","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a"},"headline":"How can the default value be set in wdatepicker?","datePublished":"2024-03-16T10:11:44+00:00","dateModified":"2024-03-22T13:15:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/"},"wordCount":270,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/","url":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/","name":"How can the default value be set in wdatepicker? - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-16T10:11:44+00:00","dateModified":"2024-03-22T13:15:32+00:00","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/how-can-the-default-value-be-set-in-wdatepicker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How can the default value be set in wdatepicker?"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a","name":"Noah Thompson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","caption":"Noah Thompson"},"url":"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/28355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=28355"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/28355\/revisions"}],"predecessor-version":[{"id":62648,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/28355\/revisions\/62648"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=28355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=28355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=28355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}