bootstrap datepicker setDate format dd/mm/yyyy

前端 未结 12 899
轮回少年
轮回少年 2021-02-03 20:14

I have to set the date in my datepicker in dd/mm/yyyy format. Whet I\'m trying to do, with Javascript is this:

  var year = 2014;
  var month = 5;
  var day = 10         


        
12条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 20:33

    I have some problems with jquery mobile 1.4.5. For example it seems accepting format change only passing from "option". And there are some refresh problem with the calendar using "option". For all that have the same problems I can suggest this code:

    $( "#mydatepicker" ).datepicker( "option", "dateFormat", "dd/mm/yy" );
    $( "#mydatepicker" ).datepicker( "setDate", new Date());    
    $('.ui-datepicker-calendar').hide();
    

提交回复
热议问题