0

I have a working version of jQuery datepicker which is defaulted to today's date and display in below format,

enter image description here

I needed to format the display date like below. How can I do it?

enter image description here

Here is the JS code

viewDate = function () {
            $('#Date').datepicker({
                changeMonth: true,
                changeYear: true,
                showButtonPanel: true,
                dateFormat: "yy-mm-dd",
                minDate:"-5y",
                maxDate: 'today',
                onSelect: function(selected,evnt) {
                    doSomething(selected);
                }
            }).datepicker("setDate", "0");
        },

Thanks for your help!

3
  • 1
    Try setting date format like this: dateFormat: "dd-M-yy" and add property monthNames: ['January', 'February'...] Commented Feb 12 at 16:27
  • 1
    It's right in the docs. Why haven't you tried changing the value for dateFormat?
    – isherwood
    Commented Feb 12 at 16:50
  • 1
    @MilosStojanovic The - should be spaces.
    – Barmar
    Commented Feb 12 at 18:31

0