I have been facing an issue with the usage of datepicker in my VF page.
VF page:
<script>
jQuery(function(){
var $j = jQuery.noConflict();
$j("input[id$=expdate]").datepicker({
changeYear: true,
changeMonth: true,
dateFormat: "mm/dd/yy"
});
});
</script>
expdate is the id of the field.
<apex:pageBlockSectionItem rendered="{!ISNULL($CurrentPage.parameters.docId)}">
<apex:outputLabel value="Expiration Date" for="expdate"/>
<apex:inputText value="{!expdate}" id="expdate"/>
</apex:pageBlockSectionItem>
What should I do that the datepicker sets itself according to the user's locale settings? I would like the datepicker to be mm/dd/yy OR dd/mm/yy based on his user locale settings on Salesforce.