Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions bppoc/client/components/TransactionListItem.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react'
import moment from 'moment'

export default function TransactionListItem(props) {
const {
const {
showFrom,
showTo,
transaction
} = props;
return (
<tr>
<td>
{convertDate(transaction.timestamp)}
{moment(transaction.timestamp*1000).format('llll')}
</td>
{
showFrom ?
Expand All @@ -31,10 +32,3 @@ export default function TransactionListItem(props) {
</tr>
)
}

function convertDate(timestamp) {
var d = new Date(timestamp * 1000) //x1000 to convert from seconds to milliseconds
var s = d.toUTCString();
s = s.substring(0, s.indexOf("GMT")) + "UTC" //change the confusing 'GMT' to 'UTC' s
return s;
}
8 changes: 4 additions & 4 deletions bppoc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bppoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"graphql-tag": "^1.2.4",
"html-webpack-plugin": "^2.26.0",
"lodash": "^4.17.4",
"moment": "^2.19.0",
"mongoose": "^4.7.8",
"nodemon": "^1.12.1",
"passport": "^0.3.2",
Expand Down