Skip to content

Commit 70bd013

Browse files
authored
Merge pull request #3 from shazha/fix/PGBI#196
Fix timestamps
2 parents f2fe4e2 + 975390b commit 70bd013

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pages/index_resources/index_resources.controller.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
.module('app')
66
.controller('IndexResources', IndexResources);
77

8-
IndexResources.$inject = ["resourceType", "resourceName", "Kong", "Alert", "parentType", "parent"];
8+
IndexResources.$inject = ["resourceType", "resourceName", "Kong", "env", "Alert", "parentType", "parent"];
99

10-
function IndexResources(resourceType, resourceName, Kong, Alert, parentType, parent) {
10+
function IndexResources(resourceType, resourceName, Kong, env, Alert, parentType, parent) {
1111
var vm = this;
1212

1313
vm.resources = null;
@@ -156,8 +156,13 @@
156156
nextPage = response.offset ? fetchEndpoint + '&offset=' + encodeURIComponent(response.offset) : null;
157157
nextPageLoading = false;
158158

159+
var isTimestampInSeconds = env.kong_version >= "0.14";
160+
159161
// appending related resources, if any.
160162
vm.resources.forEach(function(resource) {
163+
if (isTimestampInSeconds && resource.created_at) {
164+
resource.created_at *= 1000;
165+
}
161166
if (!resource.api && resource.api_id) {
162167
Kong.get('/apis/' + resource.api_id).then(function(api) {
163168
resource.api = api;

0 commit comments

Comments
 (0)