Skip to content

Commit

Permalink
timestamp in v0.14 is second-level numbers as well
Browse files Browse the repository at this point in the history
  • Loading branch information
shazha committed Mar 22, 2019
1 parent f5116e6 commit 975390b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pages/index_resources/index_resources.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@
nextPage = response.offset ? fetchEndpoint + '&offset=' + encodeURIComponent(response.offset) : null;
nextPageLoading = false;

var isTimeInSeconds = isKong1xVersion(env.kong_version);
var isTimestampInSeconds = env.kong_version >= "0.14";

// appending related resources, if any.
vm.resources.forEach(function(resource) {
if (resource.created_at && isTimeInSeconds) {
if (isTimestampInSeconds && resource.created_at) {
resource.created_at *= 1000;
}
if (!resource.api && resource.api_id) {
Expand Down Expand Up @@ -231,9 +231,5 @@
});
});
};

function isKong1xVersion(versionStr) {
return versionStr >= "1.0.0" || versionStr.substring(0, 4) === "0.15"
}
}
})();

0 comments on commit 975390b

Please sign in to comment.