I have a 'DATAADMISSAO' field that receives DB information in the format below:
Iwouldliketoinputinthefollowingpattern:DD-MM-YYYY.
Belowisthejavascriptthatinsertsthedataintothefield:
functionsetSelectedZoomItem(selectedItem){varinfo=selectedItem.type.split("___");
if (info.length > 1) { }
if(selectedItem.type == "filiais"){
$("#filial").val(selectedItem['nomefantasia']);
$("#cnpj").val(selectedItem['cgc']);
$("#codfilial").val(selectedItem['codfilial']);
}else if(selectedItem.type == "setores"){
$("#setor").val(selectedItem['nomefantasia']);
}else if(selectedItem.type == "chapafunc"){
$("#chapafuncionario").val(selectedItem['CHAPA']);
$("#nomefuncionario").val(selectedItem['NOME']);
$("#cargofuncionario").val(selectedItem['FUNCAO']);
$("#dataadmissao").val(selectedItem['DATAADMISSAO']);
$("#salariofuncionario").val(selectedItem['SALARIO']);
}
}