Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update component after some time when using fromNow #1

Closed
markacola opened this issue Oct 30, 2016 · 1 comment
Closed

Update component after some time when using fromNow #1

markacola opened this issue Oct 30, 2016 · 1 comment

Comments

@markacola
Copy link
Contributor

markacola commented Oct 30, 2016

The component doesn't currently have a mechanism to update the time automatically when out of date, i.e.

import React  from 'react'
import Moment from 'react-moment'

export default () => (
  <Moment fromNow>{new Date()}</Moment>
)

outputs:

<time>a few seconds ago</time>

and the content will not update over time (in a minute it will still display "a few seconds ago").

Would you accept a pull request that adds support for this?

@headzoo
Copy link
Owner

headzoo commented Nov 2, 2016

Pull request was accepted. See #2

@headzoo headzoo closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants