我使用的是tarruda的bootstrap-datetimepicker,我见过这个documentation,但是当我尝试用DD/mm/yyyy格式化它时,它不起作用,它给了我DD/02/2013。我希望它像Mon Dec 02 2013一样。有什么帮助吗?
下面是我的代码:
<div class='input-append date' id='datetimepicker1'>
<input name="bdate" date-format='DD/mm/yyyy' type='text' placeholder="Date"/>
<span class='add-on'>
<i data-date-icon='icon-calendar' data-time-icon='icon-time'>
</i>
</span>
</div>
<script type="text/javascript">
$(function() {
$('#datetimepicker1').datetimepicker({
pickTime:false,
format: 'DD/mm/yyyy'
});
});
</script> 发布于 2016-08-24 07:46:27
Moment JS Doc日期选择器使用MomentJS,下面是Bootsrap的链接
下面是正确的代码。
$('#datetimepicker1').datetimepicker({
pickTime: false,
format: 'ddd MMM DD YY'
});发布于 2013-11-14 19:27:30
bootstrap没有日期时间选择器。这是jquery UI小部件!看看这个http://api.jqueryui.com/datepicker/你的格式是不正确的,试试
$('#datetimepicker1').datetimepicker({
pickTime:false,
format: 'dd/mm/yy'
});格式可以是以下各项的组合:
d - day of month (no leading zero)
dd - day of month (two digit)
o - day of the year (no leading zeros)
oo - day of the year (three digit)
D - day name short
DD - day name long
m - month of year (no leading zero)
mm - month of year (two digit)
M - month name short
MM - month name long
y - year (two digit)
yy - year (four digit)
@ - Unix timestamp (ms since 01/01/1970)
! - Windows ticks (100ns since 01/01/0001)
'...' - literal text
'' - single quote
anything else - literal texthttps://stackoverflow.com/questions/19976088
复制相似问题