ASP.Net MVC jQuery UI的DatePicker的日期格式 [英] ASP.Net MVC jQuery UI DatePicker Date Format
本文介绍了ASP.Net MVC jQuery UI的DatePicker的日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我无计可施试图迫使这个jQuery的日期选择器控制,以了解具体的日期格式。这到底是怎么回事?
I'm at my wits end trying to force this jQuery datepicker control to understand specific date formats. What the hell is going on here?
查看
@Html.TextBoxFor(model => model.StartDate, "{0:dd/MM/yyyy}", new { @class = "datefield" })
的JavaScript
Javascript
$(function () {
$(".datefield").datepicker({
dateFormat: 'dd/MM/yyyy',
showOn: "button"
});
});
在页面加载
点击日期选择器,到目前为止好
datepicker clicked, so far so good
日期选择......什么?
date selected... what?
推荐答案
-
DD
- 月中的某一天(两位数) -
MM
- 月份名称长 -
YY
- 年(四位数)
dd
- day of month (two digit)MM
- month name longyy
- year (four digit)
所以 DD / MM / YYYY
的应的产生的结果。 (当天,长月份名称和4位数每年两次),以配合您最初加载格式,你想要这样的:
So dd/MM/yyyy
should produce that result. (The day, the long month name, and the 4-digit year twice.) To match your initially loaded format, you'd want this:
dd/mm/yy
这篇关于ASP.Net MVC jQuery UI的DatePicker的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文