Skip to content

Commit

Permalink
make create and finished datetime relative
Browse files Browse the repository at this point in the history
  • Loading branch information
messa committed May 6, 2017
1 parent 9df6b52 commit 8fd6527
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions components/todo_list.js
@@ -1,4 +1,5 @@
import React, {Component} from 'react';
import TimeAgo from 'react-timeago'
import {
Table,
TableBody,
Expand Down Expand Up @@ -60,7 +61,7 @@ const CreatedDateCell = (props) => {
wordWrap: 'break-word'
}}
>
{ item.createDate.toString() }
<TimeAgo date={item.createDate} />
</TableRowColumn>
);
};
Expand All @@ -74,17 +75,15 @@ const FinishedDateCell = (props) => {
wordWrap: 'break-word'
}}
>
{
item.finishedDate
? item.finishedDate.toString()
: (
<FlatButton
label="Finish"
secondary={true}
onTouchTap={(event) => handleFinishItem(item)}
/>
)
}
{item.finishedDate ? (
<TimeAgo date={item.finishedDate} />
) : (
<FlatButton
label="Finish"
secondary={true}
onTouchTap={(event) => handleFinishItem(item)}
/>
)}
</TableRowColumn>
);
};
Expand Down

0 comments on commit 8fd6527

Please sign in to comment.