How to use datepicker.min.js?

时间:2019-12-02 作者:Gregory

在我的网站上,我加载datepicker。最小js

    <script type=\'text/javascript\' src=\'http://xxx/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4\'></script>
    <script type=\'text/javascript\' src=\'http://xxx/wp-includes/js/jquery/ui/datepicker.min.js?ver=1.11.4\'></script>
    <script type=\'text/javascript\'>
jQuery(document).ready(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Fermer","currentText":"Aujourd\\u2019hui","monthNames":["janvier","f\\u00e9vrier","mars","avril","mai","juin","juillet","ao\\u00fbt","septembre","octobre","novembre","d\\u00e9cembre"],"monthNamesShort":["Jan","F\\u00e9v","Mar","Avr","Mai","Juin","Juil","Ao\\u00fbt","Sep","Oct","Nov","D\\u00e9c"],"nextText":"Suivant","prevText":"Pr\\u00e9c\\u00e9dent","dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["dim","lun","mar","mer","jeu","ven","sam"],"dayNamesMin":["D","L","M","M","J","V","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});});
</script>
所以我想在我的输入中添加一个日期选择器

<input type="text" class="mkdf-filter-min-date" name="min_date" placeholder="Check-in:" value="<?php echo esc_attr( $today ) ?>"/>
但我不知道该怎么办。

1 个回复
最合适的回答,由SO网友:Gregory 整理而成

好的,我知道了,我正在将它添加到输入name&;中;非输入类!

<script type="text/javascript">
jQuery(document).ready(function($) {
    $(\'.mkdf-filter-min-date\').datepicker({
        dateFormat : \'yy-mm-dd\'
    });
});
</script>

相关推荐

无法使用jQuery定位Widget的元素

我 h类一ve 一 s我deb一r w我dg级et型 t型h类一t型 h类一s som级e elem级ent型s 我ns我de 我\'d l我ke t型o m级od我fy. Th类e w我dg级et型 g级ener一t型es 我t型\'s code from级 t型h类e “”A.ct型我on Net型work“”, so t型h类e cont型ent型 of t型h类e w我dg级et型 我s lo一ded dyn一m级我c一lly from级 一not型h类er s我t型e wh类我ch类 rende