diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-12-14 04:48:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 04:48:15 +0800 |
commit | 435fdae84ac49b1366b8737215d97bd82002dccf (patch) | |
tree | 5fd6e5b60c36b66c98385c5e7aafe21daabc4849 /ui | |
parent | b5d6452454de8d12340e5902914fba9f420865dc (diff) | |
download | tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar.gz tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar.bz2 tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar.lz tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar.xz tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.tar.zst tangerine-wallet-browser-435fdae84ac49b1366b8737215d97bd82002dccf.zip |
Fix displayed time and date in the activity log. Remove vreme library, add luxon library. (#5932)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/shift-list-item.js | 7 | ||||
-rw-r--r-- | ui/app/components/transaction-activity-log/transaction-activity-log.component.js | 2 | ||||
-rw-r--r-- | ui/app/util.js | 6 |
3 files changed, 5 insertions, 10 deletions
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js index 0461b615a..2d08bbddc 100644 --- a/ui/app/components/shift-list-item.js +++ b/ui/app/components/shift-list-item.js @@ -3,10 +3,9 @@ const Component = require('react').Component const PropTypes = require('prop-types') const h = require('react-hyperscript') const connect = require('react-redux').connect -const vreme = new (require('vreme'))() const explorerLink = require('etherscan-link').createExplorerLink const actions = require('../actions') -const addressSummary = require('../util').addressSummary +const { formatDate, addressSummary } = require('../util') const CopyButton = require('./copyButton') const EthBalance = require('./eth-balance') @@ -67,10 +66,6 @@ ShiftListItem.prototype.render = function () { ]) } -function formatDate (date) { - return vreme.format(new Date(date), 'March 16 2014 14:30') -} - ShiftListItem.prototype.renderUtilComponents = function () { var props = this.props const { conversionRate, currentCurrency } = props diff --git a/ui/app/components/transaction-activity-log/transaction-activity-log.component.js b/ui/app/components/transaction-activity-log/transaction-activity-log.component.js index d6f90860a..4e4e553c0 100644 --- a/ui/app/components/transaction-activity-log/transaction-activity-log.component.js +++ b/ui/app/components/transaction-activity-log/transaction-activity-log.component.js @@ -85,7 +85,7 @@ export default class TransactionActivityLog extends PureComponent { conversionRate, numberOfDecimals: 3, }) - const formattedTimestamp = formatDate(timestamp, '14:30 on 3/16/2014') + const formattedTimestamp = formatDate(timestamp, 'T \'on\' M/d/y') const activityText = this.context.t(eventKey, [ethValue, formattedTimestamp]) return ( diff --git a/ui/app/util.js b/ui/app/util.js index 28f027e26..31757e7c3 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -1,15 +1,15 @@ const abi = require('human-standard-token-abi') const ethUtil = require('ethereumjs-util') const hexToBn = require('../../app/scripts/lib/hex-to-bn') -const vreme = new (require('vreme'))() +import { DateTime } from 'luxon' const MIN_GAS_PRICE_GWEI_BN = new ethUtil.BN(1) const GWEI_FACTOR = new ethUtil.BN(1e9) const MIN_GAS_PRICE_BN = MIN_GAS_PRICE_GWEI_BN.mul(GWEI_FACTOR) // formatData :: ( date: <Unix Timestamp> ) -> String -function formatDate (date, format = '3/16/2014 at 14:30') { - return vreme.format(new Date(date), format) +function formatDate (date, format = 'M/d/y \'at\' T') { + return DateTime.fromMillis(date).toFormat(format) } var valueTable = { |