Skip to content

Commit

Permalink
Merge ecc4de3 into 799dd3c
Browse files Browse the repository at this point in the history
  • Loading branch information
patyiscoding authored Dec 8, 2019
2 parents 799dd3c + ecc4de3 commit e590b47
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ export default class HowtoDescription extends React.PureComponent<IProps, any> {

public durationSincePosted(postDate: Date) {
const daysSince: number = differenceInDays(new Date(), new Date(postDate))
return `${daysSince} days ago`
switch (daysSince) {
case 0:
return 'today'
case 1:
return `${daysSince} day ago`
default:
return `${daysSince} days ago`
}
}

public render() {
Expand Down

0 comments on commit e590b47

Please sign in to comment.