I found the following codes to override easyui default date format. Instead of using forward slash I want to use .(period) to separate the day, month and year. So I change the forwardslash with period(.). The problem is that I could not select the other dates other than the current date from the date pickup.
$.extend($.fn.datebox.defaults,{
formatter:function(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
return (d<10?('0'+d):d)+'/'+(m<10?('0'+m):m)+'/'+y;
//(d<10?('0'+d):d)+'.'+(m<10?('0'+m):m)+'.'+y; this works but would not allow me to choose other dates
},
parser:function(s){
if (!s) return new Date();
var ss = s.split('/');
var d = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var y = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}
});
I could not figure out what else must be changed in the codes to make it work.
Thanks.