codice:
function date2ita(data) {
if(data.length>0){
    return data.replace(/(\d{4}).(\d{2}).(\d{2})/, "$3.$2.$1");
}
}