Para gener un n煤mero a partir de la fecha, solo agreguen .getTime(), ejemplo:
saveMovement(movement) {
//Generamos el id
movement.id = new Date().getTime();
//Agregamos la fecha del movimiento
movement.time = new Date();
//Validamos si es ingreso o gasto
movement.type == "gasto" ? (movement.amount = movement.amount * -1) : "";
this.$emit("saveMovement", movement);
this.showModal = false;
},
Want to see more contributions, questions and answers from the community?