Javascript X-可编辑日期格式
对于X-可编辑的日期字段,我有以下JS和HTML。从日历弹出窗口中选择日期后,我将在输入框中看到“Wed Apr 13 2016 20:00:00 GMT-0400(东部标准时间)”作为新值。而且它不是我已经指定的格式“mm/dd/yyyy”Javascript X-可编辑日期格式,javascript,jquery,x-editable,Javascript,Jquery,X Editable,对于X-可编辑的日期字段,我有以下JS和HTML。从日历弹出窗口中选择日期后,我将在输入框中看到“Wed Apr 13 2016 20:00:00 GMT-0400(东部标准时间)”作为新值。而且它不是我已经指定的格式“mm/dd/yyyy” <input style="background-color: rgb(255, 255, 255);" title="" data-original-title="" class="editable editable-cli
<input style="background-color: rgb(255, 255, 255);"
title=""
data-original-title=""
class="editable editable-click dateinput form-control"
data-clear="false"
data-format="mm/dd/yyyy"
data-type="date"
id="my_date"
name="my_date"
required="required"
value="12/31/2016"
type="text">
<script>
$("#my_date").editable({
send: 'never',
success: function(response, newValue) {
$('#my_date').val(newValue);
}
});
</script>
$(“#我的日期”)。可编辑({
发送:“从不”,
成功:函数(响应,newValue){
$('my#u date').val(newValue);
}
});
请这样尝试。在js
文件中放入日期格式,如下所示
<script>
$("#my_date").editable({
format: 'mm/dd/yyyy',
send: 'never',
success: function(response, newValue) {
$('#my_date').val(newValue);
}
});
</script>
$(“#我的日期”)。可编辑({
格式:“mm/dd/yyyy”,
发送:“从不”,
成功:函数(响应,newValue){
$('my#u date').val(newValue);
}
});