jQuery UI DatePicker - Change Date Format

前端 未结 28 2288
后悔当初
后悔当初 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 17:24

    If you need the date in yy-mm-dd format,you can use this:-

    $("#datepicker").datepicker({ dateFormat: "yy-mm-dd" });
    

    You can find all the supported format https://jqueryui.com/datepicker/#date-formats

    I was in need of 06,Dec 2015,I did this:-

    $("#datepicker").datepicker({ dateFormat: "d M,y" });
    

提交回复
热议问题