Skip to content

Commit

Permalink
Fixed date issue
Browse files Browse the repository at this point in the history
  • Loading branch information
haideralipunjabi committed May 3, 2021
1 parent 7624b06 commit 9dfe697
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ $(document).ready(() => {
API_DISTRICT.then((data) => {
$("progress").addClass("is-hidden");
districtsMap = data["districtMap"];

$("#map_date").html(districtsMap["date"]);
delete districtsMap["date"];
loadDistricts();
loadMap();
});
Expand Down Expand Up @@ -356,7 +357,7 @@ function loadSamplesData(data) {
$("#stats_recper").removeClass("loadanim");
$("#stats_decper").removeClass("loadanim");
$("#stats_date").html(data["date"]);
$("#map_date").html(data["date"]);
// $("#map_date").html(data["date"]);
$("#stats_samples").html(data["stats"]["total"]);
$("#stats_samples_avg").html(data["stats"]["average"].toFixed(2));
$("#stats_samples_today").html(data["stats"]["new"]);
Expand Down
1 change: 1 addition & 0 deletions functions/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports.DistrictMap = function (d) {
let districtMap = {};
let lastDay = data[data.length - 1];
let secondLastDay = data[data.length - 2];
districtMap["date"] = lastDay["date"]
delete lastDay["Date"];
delete secondLastDay["Date"];
for (let district of Object.keys(lastDay)) {
Expand Down

0 comments on commit 9dfe697

Please sign in to comment.