diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-05-08 00:33:34 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-05-08 00:34:11 +0800 |
commit | 97e7cb3f35dc7822f44945515fd56581f49201e2 (patch) | |
tree | cdcbac4b99a23c28a5b8eeccb9ea533da8132679 | |
parent | 4668d419842e2f7c0c1af36447ba1c3716babadf (diff) | |
download | dexon-wallet-97e7cb3f35dc7822f44945515fd56581f49201e2.tar.gz dexon-wallet-97e7cb3f35dc7822f44945515fd56581f49201e2.tar.zst dexon-wallet-97e7cb3f35dc7822f44945515fd56581f49201e2.zip |
Fix datetime display
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | app/manifest.json | 2 | ||||
-rw-r--r-- | package.json | 1 | ||||
-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 | 6 | ||||
-rw-r--r-- | ui/app/util.js | 6 |
6 files changed, 11 insertions, 13 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d551125f..533a1c67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Develop Branch +## 1.3.6 Wed May 08 2019 + ## 1.3.5 Tue May 07 2019 ## 1.3.4 Thu Apr 25 2019 diff --git a/app/manifest.json b/app/manifest.json index 46fdd75c..2e72a481 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "1.3.5", + "version": "1.3.6", "manifest_version": 2, "author": "https://dexon.org", "description": "__MSG_appDescription__", diff --git a/package.json b/package.json index f5019348..a4a58186 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,7 @@ "lodash.shuffle": "^4.2.0", "lodash.uniqby": "^4.7.0", "loglevel": "^1.4.1", + "luxon": "^1.13.0", "metamascara": "^2.0.0", "metamask-logo": "^2.1.4", "mkdirp": "^0.5.1", diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js index e4d24924..5e35b04d 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 { formatDate, addressSummary } = require('../util') const explorerLink = require('../../lib/account-link.js') const actions = require('../actions') -const addressSummary = require('../util').addressSummary 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 04b8ab2f..8e2b1365 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 @@ -26,9 +26,9 @@ export default class TransactionActivityLog extends PureComponent { handleActivityClick = hash => { const { primaryTransaction } = this.props - const { metamaskNetworkId } = primaryTransaction + const { dekusanNetworkId } = primaryTransaction - const prefix = prefixForNetwork(metamaskNetworkId) + const prefix = prefixForNetwork(dekusanNetworkId) const etherscanUrl = `https://${prefix}dexonscan.app/transaction/${hash}` global.platform.openWindow({ url: etherscanUrl }) @@ -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 5318c58a..e2aa057d 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 || 0).toFormat(format) } var valueTable = { |