In your case I would suggest to check the language like
var userLang = navigator.language || navigator.userLanguage;
// detect browser language but not a decent one
if (userLang === "en-US") {
$( ".selector" ).datepicker( "option", "dateFormat", "mm/dd/yyyy" );
} else {
$( ".selector" ).datepicker( "option", "dateFormat", "dd/mm/yyyy" );
}
Update:
I was looking into localization of jQuery datepicker, and here is a nice discussion and a nice plugin for it.
jQuery-localization, which detects the language and loads the respective regional language for it
$.localise('js/jquery.ui.datepicker');
Note: By default, it looks at the locale set for the browser and requests localisations of the specified package based on that. For example, if the locale is Portuguese/Brazil (pt-BR), it will load js/jquery.ui.datepicker-pt.js and js/jquery.ui.datepicker-pt-BR.js.