From 82504ae965af9db892daa21c7d0c5bd59d099195 Mon Sep 17 00:00:00 2001 From: kumavis Date: Fri, 13 May 2016 17:02:33 -0700 Subject: [PATCH] ui - txList - add time --- package.json | 1 + ui/app/components/transaction-list.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/package.json b/package.json index 15e4c853f..d7f41097f 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "textarea-caret": "^3.0.1", "three.js": "^0.73.2", "through2": "^2.0.1", + "vreme": "^3.0.2", "web3": "ethereum/web3.js#0.16.0", "web3-provider-engine": "^7.6.3", "xtend": "^4.0.1" diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index fd6a0b2ff..2a1442b8c 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -1,4 +1,5 @@ const h = require('react-hyperscript') +const vreme = new (require('vreme')) const formatBalance = require('../util').formatBalance const addressSummary = require('../util').addressSummary const explorerLink = require('../../lib/explorer-link') @@ -12,6 +13,7 @@ module.exports = function(transactions, network) { h('h3.flex-center.text-transform-uppercase', { style: { background: '#EBEBEB', + color: '#AEAEAE', }, }, [ 'Transactions', @@ -43,6 +45,7 @@ module.exports = function(transactions, network) { } function renderTransaction(transaction){ + var panelOpts = { key: `tx-${transaction.hash}`, identiconKey: transaction.txParams.to, @@ -51,6 +54,10 @@ function renderTransaction(transaction){ chrome.tabs.create({ url }) }, attributes: [ + { + key: 'TIME', + value: formatDate(transaction.time), + }, { key: 'TO', value: addressSummary(transaction.txParams.to), @@ -63,4 +70,8 @@ function renderTransaction(transaction){ } return h(Panel, panelOpts) +} + +function formatDate(date){ + return vreme.format(new Date(date), 'March 16 2014 14:30') } \ No newline at end of file