Reputation: 14879
I have the globalize.js file, and I want to force the dateformat to dd/mm/yyyy at a global level somewhere so then all jquery validation and datepicker etc. will pickup this dateformat.
Is this possible?
Upvotes: 0
Views: 6489
Reputation: 5596
I believe the following applied in your layout would suffice:
<script type="text/javascript">
$(function () {
$.validator.methods.date = function (value, element) {
return this.optional(element) || Globalize.parseDate(value, "dd/MM/yyyy") !== null;
}
});
</script>
Upvotes: 2