Skip to content

Commit

Permalink
Corrigindo o nome da Hint; Acertando Download do csv (Marquinho e Vit…
Browse files Browse the repository at this point in the history
…or Costa);
  • Loading branch information
ktalmeida committed Dec 9, 2014
1 parent 189769f commit cd64cd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ <h1> Preencha as informações abaixo</h1>
<div class="form-group" >
<label for="initialDate" class="col-sm-2 control-label" data-date-format="DD/MM/YYYY - HH" >Data inicial</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="initialDate" placeholder="Insira a Dara e Hora" data-date-format="DD/MM/YYYY - HH:00">
<input type="text" class="form-control" id="initialDate" placeholder="Insira a Data e Hora" data-date-format="DD/MM/YYYY - HH:00">
</div>
<label for="maxs" class="col-sm-2 control-label">Data final</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="finalDate" placeholder="Insira a Dara e Hora" data-date-format="DD/MM/YYYY - HH:00">
<input type="text" class="form-control" id="finalDate" placeholder="Insira a Data e Hora" data-date-format="DD/MM/YYYY - HH:00">
</div>
</div>

Expand Down
10 changes: 2 additions & 8 deletions public/relatorioCodigo.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,21 +323,15 @@ window.onload = function() {
csv += bus[0] + "," + bus[1] + "," + bus[2] + "," + bus[3] + "," + bus[4] + "," + bus[5] + "," + bus[6] + "\n";
});
var encodedUri = encodeURI(csv);
var link = document.createElement("a");
link.setAttribute("href", "data:text/csv;charset=utf-8," + encodedUri);
link.setAttribute("download", "onibus.csv");
link.click();
document.location.href = "data:text/csv;charset=utf-8,"+ encodeURI(csv).replace("\n", "%0A");
}
if(result.lines != undefined) {
var csv = "LINHAS\n";
result.lines.map(function(line) {
csv += line + "\n";
});
var encodedUri = encodeURI(csv);
var link = document.createElement("a");
link.setAttribute("href", "data:text/csv;charset=utf-8," + encodedUri);
link.setAttribute("download", "linhas.csv");
link.click();
document.location.href = "data:text/csv;charset=utf-8,"+ encodeURI(csv).replace("\n", "%0A");
}
});
}
Expand Down

0 comments on commit cd64cd0

Please sign in to comment.