Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/03/2016, 12:33
lamenenchu
 
Fecha de Ingreso: mayo-2015
Mensajes: 92
Antigüedad: 9 años
Puntos: 1
Respuesta: función añadir día a la fecha actual

Cita:
Iniciado por Alexis88 Ver Mensaje
¿Podrías mostrarnos el código actualizado?
Michas gracias por tus respuestas Alexis.

//Fecha día anterior
$scope.previousDay = function(){
var date = new Date();
var newdate = new Date(date);
newdate.setDate(newdate.getDate() - 1);

var dd = newdate.getDate();
if (dd<10){
dd = "0" + dd;
}
var MM = newdate.getMonth() + 1;
if (MM < 10) {
MM = "0" + MM;
}
var yyyy = newdate.getFullYear();

var today = dd + '-' + MM + '-' + yyyy;
$scope.date= today;
console.log(date);

$http.get('/agd/getIntervencion/'+today).success(function (data) {

$scope.intervenciones = data;

//mostrar intervenciones por día
for (var i in $scope.intervenciones) {
var actualDate = $scope.intervenciones.today;
if($scope.intervenciones[i].date === actualDate){
$scope.intervenciones[i].tipo;

}

}

}).error(function (data, status) {
// console.log("errrorrrrrrrrrrrr");
});

}