2016-07-23 4 views

答えて

0

てみてください。現在の日付を設定するための

使用setDatenew Date()

$('#datepicker').datepicker().datepicker('setDate', 'today');
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
 
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
 
<input type="text" id="datepicker" />

+0

それは動作していません –

+0

@ taiaburrahmanその作業は今それを確認します –

+0

それは私の現在のJQのバージョンで快適ではありません。別の解決策を見つける。 datepicker( 'setDate'、 '0'); '$( '#datepicker')。 –

0

この

$(function() { 
      var currentDate = new Date(); 
      $('#datepicker').datepicker({ 
       inline: true, 
       showOtherMonths: true, 
       dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 
       dateFormat: 'dd/mm/yy' 
      }); 
      $("#datepicker").datepicker("setDate", currentDate); 
     }) 

HTMLコード

 <tr> 
     <td width="190"><input style="width: 85px; color:#27AAE1; font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 0.8em;" type="text" id="datepicker" /></td> 
    </tr> 
</table> 
関連する問題