bootstrap datepicker setDate format dd/mm/yyyy

前端 未结 12 1029
轮回少年
轮回少年 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

    "As with bootstrap’s own plugins, datepicker provides a data-api that can be used to instantiate datepickers without the need for custom javascript..."

    Boostrap DatePicker Documentation

    Maybe you want to set format without DatePicker instance, for that, you have to add the property data-date-format="DateFormat" to main Div tag, for example:

提交回复
热议问题