Skip to content

Commit

Permalink
include Z in date format
Browse files Browse the repository at this point in the history
  • Loading branch information
shekenahglory committed Nov 12, 2015
1 parent 58e0afe commit 76cb9a5
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 66 deletions.
56 changes: 28 additions & 28 deletions api/gateways/gateways.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "Bitstamp",
"startDate": "2013-02-22",
"start_date": "2013-02-22",
"accounts": [{
"address": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
"currencies": {
Expand All @@ -22,7 +22,7 @@
"status": "active"
}, {
"name": "RippleChina",
"startDate": "2013-05-21",

This comment has been minimized.

Copy link
@franga0184

franga0184 Mar 20, 2021

2013-05-21

"start_date": "2013-05-21",
"accounts": [{
"address": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
"currencies": {
Expand All @@ -36,7 +36,7 @@
"status": "active"
}, {
"name": "rippleCN",
"startDate": "2013-05-05",
"start_date": "2013-05-05",
"accounts": [{
"address": "rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
"currencies": {
Expand All @@ -52,7 +52,7 @@
"status": "active"
}, {
"name": "Payroutes",
"startDate": "2013-04-24",
"start_date": "2013-04-24",
"accounts": [{
"address": "rNPRNzBB92BVpAhhZr4iXDTveCgV5Pofm9",
"currencies": {
Expand All @@ -73,7 +73,7 @@
"status": "active"
}, {
"name": "SnapSwap",
"startDate": "2013-06-18",
"start_date": "2013-06-18",
"accounts": [{
"address": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"currencies": {
Expand All @@ -93,7 +93,7 @@
"status": "active"
}, {
"name": "BTC 2 Ripple",
"startDate": "2013-06-18",
"start_date": "2013-06-18",
"accounts": [{
"address": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
"currencies": {"BTC" : { "featured" : true }}
Expand All @@ -108,7 +108,7 @@
"status": "active"
}, {
"name": "The Rock Trading",
"startDate": "2013-05-19",
"start_date": "2013-05-19",
"accounts": [{
"address": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
"currencies": {
Expand All @@ -125,7 +125,7 @@
"status": "active"
}, {
"name": "WisePass",
"startDate": "2013-04-28",
"start_date": "2013-04-28",
"accounts": [{
"address": "rPDXxSZcuVL3ZWoyU82bcde3zwvmShkRyF",
"currencies": {
Expand Down Expand Up @@ -156,7 +156,7 @@
"status": "active"
}, {
"name": "RippleUnion",
"startDate": "2013-03-22",
"start_date": "2013-03-22",
"accounts": [{
"address": "r3ADD8kXSUKHd6zTCKfnKT3zV9EZHjzp1S",
"currencies": {
Expand All @@ -168,7 +168,7 @@
"status": "active"
},{
"name": "Justcoin",
"startDate": "2013-07-29",
"start_date": "2013-07-29",
"accounts": [{
"address": "rJHygWcTLVpSXkowott6kzgZU6viQSVYM1",
"currencies": {
Expand All @@ -184,7 +184,7 @@
"status": "active"
}, {
"name": "DotPayco",
"startDate": "2013-06-02",
"start_date": "2013-06-02",
"accounts": [{
"address": "rM8199qFwspxiWNZRChZdZbGN5WrCepVP1",
"currencies": {"CNY" : { "featured" : false }}
Expand All @@ -196,7 +196,7 @@
"status": "active"
}, {
"name": "Ripple Singapore",
"startDate": "2014-01-25",
"start_date": "2014-01-25",
"accounts": [{
"address": "r9Dr5xwkeLegBeXq6ujinjSBLQzQ1zQGjH",
"currencies": {
Expand All @@ -211,7 +211,7 @@
"status": "active"
}, {
"name": "Ripple Trade Japan",
"startDate": "2014-02-21",
"start_date": "2014-02-21",
"accounts": [{
"address": "rMAz5ZnK73nyNUL4foAvaxdreczCkG3vA6",
"currencies": {"JPY" : { "featured" : false }}
Expand All @@ -223,7 +223,7 @@
"status": "active"
}, {
"name": "Bitso",
"startDate": "2014-05-22",
"start_date": "2014-05-22",
"accounts": [{
"address": "rG6FZ31hDHN1K5Dkbma3PSB5uVCuVVRzfn",
"currencies": {
Expand All @@ -238,7 +238,7 @@
"status": "active"
}, {
"name": "Coinex",
"startDate": "2014-04-01",
"start_date": "2014-04-01",
"accounts": [{
"address": "rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc",
"currencies": {
Expand All @@ -256,7 +256,7 @@
"status": "active"
}, {
"name": "Ripple LatAm",
"startDate": "2014-05-01",
"start_date": "2014-05-01",
"accounts": [{
"address": "rP5ShE8dGBH6hHtNvRESdMceen36XFBQmh",
"currencies": {
Expand All @@ -278,7 +278,7 @@
"status": "active"
}, {
"name": "Ripple Fox",
"startDate": "2014-04-19",
"start_date": "2014-04-19",
"accounts": [{
"address": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
"currencies": {
Expand All @@ -296,7 +296,7 @@
"status": "active"
}, {
"name": "GBI",
"startDate": "2014-07-28",
"start_date": "2014-07-28",
"accounts": [{
"address": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67",
"currencies": {
Expand All @@ -309,7 +309,7 @@
"status": "active"
}, {
"name": "Lake BTC",
"startDate": "2014-05-19",
"start_date": "2014-05-19",
"accounts": [{
"address": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2",
"currencies": {
Expand All @@ -323,7 +323,7 @@
"status": "active"
}, {
"name": "TokyoJPY",
"startDate": "2014-08-18",
"start_date": "2014-08-18",
"accounts": [{
"address": "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN",
"currencies": {"JPY" : { "featured" : true }}
Expand All @@ -336,7 +336,7 @@
"featured" : true
}, {
"name": "Rippex",
"startDate": "2014-09-13",
"start_date": "2014-09-13",
"accounts": [{
"address": "rfNZPxoZ5Uaamdp339U9dCLWz2T73nZJZH",
"currencies": {"BRL" : { "featured" : true }}
Expand All @@ -346,7 +346,7 @@
"status": "active"
}, {
"name": "Digital Gate Japan",
"startDate": "2014-08-12",
"start_date": "2014-08-12",
"accounts": [{
"address": "rJRi8WW24gt9X85PHAxfWNPCizMMhqUQwg",
"currencies": {"JPY" : { "featured" : true }}
Expand All @@ -356,7 +356,7 @@
"status": "active"
}, {
"name": "Pax Moneta",
"startDate": "2014-09-06",
"start_date": "2014-09-06",
"accounts": [{
"address": "rUkMKjQitpgAM5WTGk79xpjT38DEJY283d",
"currencies": {
Expand All @@ -371,7 +371,7 @@
"status": "active"
}, {
"name": "Ripple Exchange Tokyo",
"startDate": "2014-09-25",
"start_date": "2014-09-25",
"accounts": [{
"address": "r9ZFPSb1TFdnJwbTMYHvVwFK1bQPUCVNfJ",
"currencies": {"JPY" : { "featured" : true }}
Expand All @@ -381,7 +381,7 @@
"status": "active"
}, {
"name": "Ripula",
"startDate": "2014-10-16",
"start_date": "2014-10-16",
"accounts": [{
"address": "rBycsjqxD8RVZP5zrrndiVtJwht7Z457A8",
"currencies": {"GBP" : { "featured" : true }}
Expand All @@ -393,7 +393,7 @@
"status": "active"
}, {
"name": "Mr. Ripple",
"startDate":"2014-10-5",
"start_date":"2014-10-05",
"accounts": [{
"address": "rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS",
"currencies": {
Expand All @@ -408,7 +408,7 @@
"status" : "active"
}, {
"name": "Gatehub",
"startDate":"2015-2-15",
"start_date":"2015-02-15",
"accounts": [{
"address": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
"currencies": {
Expand All @@ -421,7 +421,7 @@
"status" : "active"
}, {
"name": "EXRP",
"startDate":"2015-3-16",
"start_date":"2015-03-16",
"accounts": [{
"address": "rPxU6acYni7FcXzPCMeaPSwKcuS2GTtNVN",
"currencies": {
Expand Down
2 changes: 1 addition & 1 deletion api/routesV2/accountBalances.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var accountBalances = function (req, res, next) {
};

results.ledger_index = opts.ledger_index;
results.close_time = opts.closeTime + 'Z';
results.close_time = opts.closeTime;
results.limit = opts.limit;
results.balances = balances;

Expand Down
4 changes: 4 additions & 0 deletions api/routesV2/gateways.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var Logger = require('../../lib/logger');
var log = new Logger({scope: 'gateways'});
var path = require('path');
var smoment = require('../../lib/smoment');
var validator = require('ripple-address-codec');
var assetPath = path.resolve(__dirname + '/../gateways/gatewayAssets/');
var currencies = path.resolve(__dirname + '/../gateways/currencyAssets/');
Expand All @@ -27,6 +28,9 @@ files.forEach(function(file) {
gatewayList.forEach(function(gateway) {
gateway.normalized = normalize(gateway.name);
gateway.assets = assets[gateway.normalized] || [];
if (gateway.start_date) {
gateway.start_date = smoment(gateway.start_date).format();
}
});

// cached in memory since
Expand Down
3 changes: 2 additions & 1 deletion api/routesV2/getLastValidated.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var Logger = require('../../lib/logger');
var log = new Logger({scope : 'last validated'});
var smoment = require('../../lib/smoment');
var hbase;

var getLastValidated = function(req, res, next) {
Expand All @@ -19,7 +20,7 @@ var getLastValidated = function(req, res, next) {
ledger_index: resp.ledger_index,
ledger_hash: resp.ledger_hash,
parent_hash: resp.parent_hash,
close_time: resp.close_time
close_time: smoment(resp.close_time).format()
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions api/routesV2/getPayments.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var getPayments = function (req, res, next) {
resp.rows.forEach(function(r) {
delete r.rowkey;
if (options.interval) {
r.start = r.date;
r.start = smoment(r.date).format();
r.total_amount = r.amount;
r.average_amount = r.average;
delete r.date;
Expand All @@ -84,7 +84,7 @@ var getPayments = function (req, res, next) {
}

} else {
r.executed_time = smoment(r.executed_time).moment.format();
r.executed_time = smoment(r.executed_time).format();
}
});

Expand Down
19 changes: 18 additions & 1 deletion api/routesV2/network/getMetric.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,27 @@ function getMetric(metric, req, res) {
options.live = true;
}

hbase.getMetric(options, function(err, resp){
hbase.getMetric(options, function(err, resp) {
if (err) {
errorResponse(err);
} else {
resp.rows.forEach(function(row){
if (row.time) {
row.date = smoment(row.time).format();
delete row.time;
}

if (row.startTime) {
row.start_time = smoment(row.startTime).format();
delete row.startTime;
}

if (row.endTime) {
row.end_time = smoment(row.endTime).format();
delete row.endTime;
}
});

successResponse(resp);
}
});
Expand Down
Loading

0 comments on commit 76cb9a5

Please sign in to comment.