我正在更改日期选择器日期格式,但是不能通过默认日期格式更改日期格式就像这样 MM / DD / YYY
$(document).ready(function () {
$("#datetimepicker8").datepicker({
dateFormat: "dd-mm-yy",
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
});
});
Bootstrap模板:
<div class="col-lg-10">
<div class='input-group date' id="datetimepicker8">
<input type='text' class="form-control
message" id="datesfield" name="dateSelect" required="true"/>
<span class="input-group-addon">
<i class="fa fa-calendar" aria-
hidden="true"></i></span> </div>
</div>
答案 0 :(得分:0)
试试这个,在适用的地方替换代码。
{{1}}
答案 1 :(得分:0)
也许你没有加载正确的图书馆(js,css)!
这是一个使用与您相同代码的示例:
$(document).ready(function () {
$("#datetimepicker8").datepicker({
dateFormat: "dd-mm-yy",
icons: {
time: "fa fa-clock-o",
date: "fa fa-calendar",
up: "fa fa-arrow-up",
down: "fa fa-arrow-down"
}
});
});