Change Date Format on jQuery UI Date Picker

I have been trying to format the datepicker so that the date comes out like this:

Jul 23 15

I have been reading this question jQuery UI DatePicker – Change Date Format

But for some reason it is not working for me. I am still learning jQuery so any help on this would be greatly appreciated.

My code is below:

                          onSelect: function(dateText, inst) { 
                            var date = $(this).datepicker('getDate'),
                                day  = date.getDate(),  
                                month = date.getMonth() + 1,              
                                year =  date.getFullYear();
                            var parent_div = $(this).closest(".clickable-text");
                            $(".Jquery_day", parent_div).html(day);
                            $(".Jquery_month", parent_div).html(month);
                            $(".Jquery_year", parent_div).html(year); 


                    $(window).load(function() {

                    $('input').datepicker("setDate", new Date());

                   var dateFormat = $('input').datepicker({dateFormat: "M-d-y"}).val();

<script src=""></script>

Source: jquery

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.