2013-11-14 43 views
2

我使用的是从tarruda自举的DateTimePicker,我已经看到了这个documentation但是,当我试图格式化与DD/mm/yyyy它不工作,它给了我DD/02/2013。我希望它像Mon Dec 02 2013。任何帮助?
这里是我的代码:自举的DateTimePicker格式不起作用

 <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> 

回答

-3

引导没有一个DateTimePicker。这是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 text 
+0

您确实访问过我提供的链接吗? – leonardeveloper

0

Bootsrap的DateTimePicker使用MomentJS这里是链接到Moment JS Doc

以下是正确的代码。

$('#datetimepicker1').datetimepicker({ 
    pickTime: false, 
    format: 'ddd MMM DD YY' 
});