bootstrap datepicker setDate format dd/mm/yyyy

前端 未结 12 1050
轮回少年
轮回少年 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条回答
  •  Happy的楠姐
    2021-02-03 20:24

    Try this

     format: 'DD/MM/YYYY hh:mm A'
    

    As we all know JS is case-sensitive. So this will display

    10/05/2016 12:00 AM

    In your case is

    format: 'DD/MM/YYYY'
    

    Display : 10/05/2016

    My bootstrap datetimepicker is based on eonasdan bootstrap-datetimepicker

提交回复
热议问题