gpt4 book ai didi

jquery - 在实现 css 中更改日期选择器的语言

转载 作者:搜寻专家 更新时间:2023-10-31 21:58:50 25 4
gpt4 key购买 nike

我正在尝试更改具体化 css 版本 0.99.0 实际中的日期选择器的语言,但不起作用。我尝试在 * 日期选择器 defaults.in materialize.js 上更改语言,但也没有用。有人知道怎么做吗?谢谢。

html:

 <div class="input-field col s6">
<input type="date" class="datepicker" id="pickdate">
<label for="pickdate">DATA</label>
</div>

JavaScript:

    $( document ).ready(function() {
$('.datepicker').pickadate({
format: 'dd/mm/yyyy',
selectMonths: true, // Creates a dropdown to control month
selectYears: 15 // Creates a dropdown of 15 years to control year



});

最佳答案

在 materializecss 1.0.0-beta 中将 i18n 对象设置为西类牙语翻译:

$('.datepicker').datepicker({ 
firstDay: true,
format: 'yyyy-mm-dd',
i18n: {
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Dic"],
weekdays: ["Domingo","Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
weekdaysShort: ["Dom","Lun", "Mar", "Mie", "Jue", "Vie", "Sab"],
weekdaysAbbrev: ["D","L", "M", "M", "J", "V", "S"]
}
});

关于jquery - 在实现 css 中更改日期选择器的语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45155907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com