This repository was archived by the owner on Jul 10, 2019. It is now read-only.
This repository was archived by the owner on Jul 10, 2019. It is now read-only.
Closed
Description
Here are some possible solutions:
- Change the signature of format to be
format(date, now)
.now
would be optional. - Add a
now
option to the constructor. This could be either a Date/number constant or a function reference.
My motivation for this request is to use intl-relativeformat from within a React component. I can use this from within React now, but idiomatic React components are supposed to be pure functions of this.props
and this.state
. Having my render function call Date.now
is somewhat of an antipattern.
Let me know what you think. I'd be happy to put together a PR.