Skip to content

Commit

Permalink
using iso short format for dates in agent app
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMohr committed Jun 24, 2020
1 parent 421b8b0 commit e09faa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/agent/app/src/components/TransactionFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function TransactionFilters({
format={MMDDYY_FORMAT}
onChange={onDateRangeChange}
startDate={dateRangeFilter.start}
format={'YYYY-MM-DD'}
/>
</div>
)
Expand Down
6 changes: 3 additions & 3 deletions apps/agent/app/src/components/Transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import TransactionFilters from './TransactionFilters'
import { TRANSACTION_TYPES_LABELS } from '../transaction-types'
import useDownloadData from './useDownloadData'
import useFilteredTransactions from './useFilteredTransactions'
import { ISO_FORMAT, MMDDYY_FUNC_FORMAT } from '../lib/date-utils'
import { ISO_SHORT_FORMAT } from '../lib/date-utils'
import { addressesEqual, toChecksumAddress } from '../lib/web3-utils'
import AgentSvg from './assets/agent_badge.svg'

Expand Down Expand Up @@ -175,7 +175,7 @@ const Transactions = React.memo(function Transactions({
const [{ token, amount, to, from } = {}] = tokenTransfers
const onlyOne = tokenTransfers.length === 1
const entity = to || from
const formattedDate = format(date, ISO_FORMAT)
const formattedDate = format(date, ISO_SHORT_FORMAT)
const isValidEntity =
typeof targetContract === 'string' && tokenTransfers.length > 0

Expand All @@ -188,7 +188,7 @@ const Transactions = React.memo(function Transactions({
color: ${theme.surfaceContent};
`}
>
{format(date, MMDDYY_FUNC_FORMAT)}
{format(date, ISO_SHORT_FORMAT)}
</time>
)
const badgeNode = onlyOne ? (
Expand Down
4 changes: 2 additions & 2 deletions apps/agent/app/src/components/useDownloadData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { saveAs } from 'file-saver'
import { formatTokenAmount } from '@aragon/ui'
import { IdentityContext } from './IdentityManager/IdentityManager'
import { toChecksumAddress } from '../lib/web3-utils'
import { formatDate, ISO_SHORT_FORMAT } from '../lib/date-utils'
import { ISO_SHORT_FORMAT } from '../lib/date-utils'
import { TRANSACTION_TYPES_LABELS } from '../transaction-types'

// Transforms a two dimensional array into a CSV data structure
Expand Down Expand Up @@ -41,7 +41,7 @@ async function getDownloadData({ transactions, tokenDetails, resolveAddress }) {
})
)
return [
formatDate(date),
format(date, ISO_SHORT_FORMAT),
source,
recipient,
TRANSACTION_TYPES_LABELS[type],
Expand Down

0 comments on commit e09faa8

Please sign in to comment.