tarun satepuri
tarun satepuri

Reputation: 23

date picker date format issue in jquery-ui.js plug in

Hi I am developing an application.In that application initially I have date formats as mm/dd/yy.Now I have to change that formats to yy/mm/dd.I have lot of selectors, I couldn't change format for each individual selector by giving date format in it.I want to change that default date format in plugin,so that it would apply to my over all application.

Pls give me suggestions :)

I have tried this in my jquery-ui.js plug in //code

 $.datepicker.setDefaults({<br>
                   showOn: "button",<br>
                   buttonImageOnly: true,<br>
                   buttonImage:         'http://jqueryui.com/resources/demos/datepicker/images/calendar.gif',<br>
                   buttonText: "Calendar",<br>
                   dateFormat: 'yy-mm-dd'<br> 
               });

Upvotes: 0

Views: 110

Answers (1)

Vikrant
Vikrant

Reputation: 5036

Try below code:

$('body').on('focus',".datepicker_recurring_start", function(){
    $(this).datepicker({ dateFormat: 'yy-mm-dd' }).val();
});

Here is Demo

Upvotes: 1

Related Questions