bootstrap datepicker setDate format dd/mm/yyyy

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

    format : "DD/MM/YYYY" should resolve your issue. If you need more help regarding available formats, please visit http://momentjs.com/ which is used by this control internally.

    I was facing an issue where this "format" thing was working fine on local machine but when I deployed the application on server, the date was not getting populated and the control was empty. when I commented the format code, it started working but then I didn't have the format that I needed. I fixed that issue using globalization entries in web.config.

    
            
    
    

    This helped in ensuring that both local & server environments have same culture.

提交回复
热议问题