I want to format my date in dd/mm/yy
. This is my code, it doesn't work:
var lStartDate = $('#datepicker').datepicker({ dateFormat: 'dd/mm/yy' }).val();
alert(lStartDate)
Now I receive alert with "06/29/2017"
试用
$('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' }).val();
我刚刚找到了正确的解决方案:
var lStartDate = $("#datepicker").datepicker("option", "dateFormat", "dd-mm-yy").val()
<input type=text data-date-format='dd/mm/yy' class="form-control" required>
尝试这个
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.