-2
I have a screen where register days, times, among others and a screen to edit this data, if necessary. When I click on the button to edit such date I get the data right.
The point is that on the edit screen I want the date field to be type=date
, to appear the calendar and the person choose the new date, however, that way the date 20/09/2019 does not appear in the fields, only appears that the field is of the type text
(type=text
).
Someone knows how to adjust it?
Follows the html
with the date field
<form name="formGrade">
<div>
Data
</div>
<div>
<input class="form-control" type="date"
ng-model="agenda.data"
name="dia" id="" required />
</div>
</form>
Javascript:
var getHorario = function(){
var id = $scope.id;
var idempresa = $scope.idempresa;
var opcao = 'pegar horario';
$http.get(getUrlOptionPrefix + opcao + '&id=' + id+ '&idempresa=' + idempresa)
.then(function(response){
$scope.agenda = response.data;
})
}
getHorario();
of your code?
– novic
The html is there in the description! I don’t understand.
– GustavoSevero
minimum and verifiable code, ie all problem code... Cade javascript?
– novic
I just posted...
– GustavoSevero
This problem is because the date is coming in the wrong format (
A questão é que na tela de edição eu quero que o campo data seja "type=date", para aparecer o calendário e a pessoa escolher a nova data, PORÉM, dessa forma a data "20/09/2019" não aparece no campos... Só aparece que o campo for do tipo text "type=text". Alguém sabe como ajustar isso?
) would have to be 2019-06-20 for example https://jsfiddle.net/swh63fyk/– novic
Now I got.... I followed the example of the link above. Thanks @Virgilionovic
– GustavoSevero