jQuery UI DatePicker - Change Date Format

前端 未结 28 1801
后悔当初
后悔当初 2020-11-21 16:39

I am using the UI DatePicker from jQuery UI as the stand alone picker. I have this code:

And the

28条回答
  •  灰色年华
    2020-11-21 16:58

    Try to use the

    $( ".selector" ).datepicker({ dateFormat: 'dd/mm/yy' });  
    

    and there is lots of option available For the datepicker you can find it Here

    http://api.jqueryui.com/datepicker/
    

    This is the way we call the datepicker with the parameter

    $(function() {
          $('.selector').datepicker({
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                numberOfMonths: 1,
                buttonImage: 'contact/calendar/calendar.gif',
                buttonImageOnly: true,
                onSelect: function(selectedDate) {
                     // we can write code here 
                 }
          });
    });
    

提交回复
热议问题