这是我的Html: -
<form method="post" id="form1" >
<div class="input-group input-medium date date-picker" data-date-format="D d M yyyy" data-date-start-date="+0d">
<input name="bookingDate" class="form-control" readonly="" type="text">
<span class="input-group-btn">
<button class="btn default" type="button">
<i class="fa fa-calendar"></i>
</button>
</span>
</div>
<button type="button" name="Detailbtn1" class="btn green Detailsave">Save</button>
</form>
<div class="col-sm-8 border-left">
<ul>
<li class="bookingDate"></li>
</ul>
</div>
Js: -
$('.Detailsave').click(function () {
var thisClass = $(this);
var FormData = $(this).closest('form').serializeArray();
var result = {};
$.each(FormData, function (i, field) {
result[field.name] = field.value;
});
$.ajax({
type: 'POST',
url: Routing.generate('save_detail'),
data: {'data': result},
success: function (data) {
$.each(data[0], function (key, value) {
var className = document.getElementsByClassName(key);
$(className).text(data[0][key]);
});
}
});
});
响应如下: -
[{
"Id":20,
"bookingDate":{
"date":"2017-02-13 13:45:00.000000",
"timezone_type":3,
"timezone":"Asia\/Kolkata"
}
}]
我想在2017年2月13日(2017年2月13日)&d; D dS F Y&#39; 格式中显示日期..那么如何更改我得到回复的日期对象的格式设置哪里找到一个班..