开发者

format in jquery ui datepicker

开发者 https://www.devze.com 2023-03-16 21:28 出处:网络
<script> $(\'#end_time\').ready(function(){ $(\'#end_time\').datepicker({ altFormat: \"yy-mm-dd h:i:s\",
<script>
$('#end_time').ready(function(){
    $('#end_time').datepicker({
        altFormat: "yy-mm-dd h:i:s",
        changeYear: true,
        changeMonth: true,
        dateFormat: "yy-mm-dd h:i:s",
        yearRange: "2011:2020"
    });
});
</script>

=> output: 2011-06-30 h:i:s I want output is: 201开发者_如何学编程1-06-30 15:14:21 Who can help me ?


CMIIW, datepicker is only to pick date. time (hour,minute,second) is not included. so the formatting for time is not there.

use this one that extend jquery ui datepicker. you can pick up both date and time.

http://trentrichardson.com/examples/timepicker/


a datepicker is for picking a DATE

there is no time component available via datepicker.

if you want to use the current time or any other time, you can write your own functions for parsing the date (without the time, so that datepicker still works) and for appending the time after picking a date

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号