user1479057
user1479057

Reputation: 61

jQuery UI datetimepicker change date & time format showed in text

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

After user change time, text field showed as 20120625 122900.

I would like to change the format for 20120625122900, without space between date and time.

Can anyone provide a good way to show the format which I want?

Upvotes: 3

Views: 19797

Answers (2)

Trufa
Trufa

Reputation: 40737

Checkout this line in the github repo.

If you change that for '' it should do the trick.

Upvotes: 0

ratexx
ratexx

Reputation: 61

<script type="text/javascript">
    $(function(){  

       // $("#datepicker").datepicker();
        $("#datepicker").datetimepicker(
                {
                    changeMonth: true,
                    changeYear: true,
                    timeFormat: 'hhmm',
                    showSecond: false,
                    dateFormat:'ymmdd',
                    separator: ''
                });


        //$('#datepicker').datetimepicker({
            //altField: "#alt_example_4_alt",
            //altFieldTimeOnly: false ,
            //timeFormat: 'hhmm' ,
            //dateFormat:'ymmdd'
        //});

    });


</script>

Upvotes: 6

Related Questions