Skip to content

Commit

Permalink
Merge pull request #43 from fasterthanlime/titlefix-gh-42
Browse files Browse the repository at this point in the history
Pass down title verbatim when specified. Closes #42
  • Loading branch information
nmn authored Jul 21, 2016
2 parents 9cee49c + 0388dbe commit 5f5bac0
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 5f5bac0

Please sign in to comment.