mirror of
https://github.com/status-im/liquid-funding.git
synced 2025-01-12 12:34:39 +00:00
add display date
This commit is contained in:
parent
9a9510f5cb
commit
119e51216e
@ -9,6 +9,7 @@ import Loading from '../base/Loading'
|
||||
import { convertTokenAmountUsd, percentToGoal } from '../../utils/prices'
|
||||
import { getTokenLabel } from '../../utils/currencies'
|
||||
import { getAmountFromWei } from '../../utils/pledges'
|
||||
import { getDateFromTimestamp } from '../../utils/dates'
|
||||
import { FundingContext } from '../../context'
|
||||
|
||||
function FundingDetail({ classes, pledgesInfos, goal, goalToken }) {
|
||||
@ -54,14 +55,16 @@ function ListProjects({ classes }) {
|
||||
<Typography className={classnames(tableHeader, classes.headerContact)}>Contact person</Typography>
|
||||
<Typography className={classnames(tableHeader, classes.dateCreated)}>Date created</Typography>
|
||||
{profiles.map((profile, i) => {
|
||||
const { id, projectInfo: { title, subtitle, goal, goalToken, creator }, pledgesInfos } = profile
|
||||
const { id, projectInfo: { title, subtitle, goal, goalToken, creator, creationTime }, pledgesInfos } = profile
|
||||
console.log({i, profile})
|
||||
const creationDate = getDateFromTimestamp(creationTime)
|
||||
return (
|
||||
<Fragment key={id}>
|
||||
<Typography className={classnames(classes.headerName, cellText)}>{title}</Typography>
|
||||
<Typography className={classnames(classes.headerDescription, cellText, classes.cellDescription)}>{subtitle}</Typography>
|
||||
<FundingDetail classes={classes} pledgesInfos={pledgesInfos} goal={goal} goalToken={goalToken} />
|
||||
<Typography className={classnames(classes.headerContact, cellText, classes.cellDescription)}>{creator}</Typography>
|
||||
<Typography className={classnames(classes.dateCreated, cellText, classes.cellDescription)}>{creationDate}</Typography>
|
||||
</Fragment>
|
||||
)
|
||||
})}
|
||||
|
@ -45,6 +45,7 @@ query Projects($type: String! = "PROJECT"){
|
||||
type
|
||||
url
|
||||
profileId
|
||||
creationTime
|
||||
projectInfo {
|
||||
id
|
||||
title
|
||||
|
@ -22,7 +22,12 @@ export function timeSinceBlock(date=false, interval) {
|
||||
export function getDateCreated(daysSince) {
|
||||
const d = new Date();
|
||||
d.setDate(d.getDate() - daysSince);
|
||||
return `${d.getMonth()}/${d.getDate()}/${d.getFullYear()}`
|
||||
return `${d.getMonth()+1}/${d.getDate()}/${d.getFullYear()}`
|
||||
}
|
||||
|
||||
export function getDateFromTimestamp(ts) {
|
||||
const daysSince = timeSinceBlock(ts, 'days')
|
||||
return getDateCreated(daysSince)
|
||||
}
|
||||
|
||||
export const convertToHours = seconds => Number(seconds) / 60 / 60
|
||||
|
Loading…
x
Reference in New Issue
Block a user