Skip to content

Commit

Permalink
Pass down title verbatim when specified. Closes #42
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jul 19, 2016
1 parent 9cee49c commit 0388dbe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ export default class TimeAgo extends Component<DefaultProps, Props, void> {
? [Math.round(seconds / MONTH), 'month']
: [Math.round(seconds / YEAR), 'year']

const passDownTitle = title
|| typeof date === 'string'
? date
: (new Date(date)).toISOString().substr(0, 16).replace('T', ' ')
const passDownTitle = typeof title === 'undefined'
? (typeof date === 'string'
? date
: (new Date(date)).toISOString().substr(0, 16).replace('T', ' '))
: title

if (Komponent === 'time') {
passDownProps.dateTime = (new Date(date)).toISOString()
Expand Down

0 comments on commit 0388dbe

Please sign in to comment.