-
Notifications
You must be signed in to change notification settings - Fork 74
Unable to override global format for FromNow #116
Copy link
Copy link
Open
Description
In our app we have set the global format like this:
Moment.globalFormat = 'MM/DD/YYYY'
In our component we are trying to use fromNow:
<Moment fromNow>2020-06-11T22:00:00.000Z</Moment>
However this displays '06/12/2020' instead of '1 hour ago'.
Expected behaviour:
'1 hour ago'
Actual behaviour:
'06/12/2020'
Is it possible to override the global format for fromNow?
I believe global format should not be applied to fromNow as the format is determined by the locale.
I have tried the following but none of them work:
<Moment fromNow format={null}>2020-06-11T22:00:00.000Z</Moment>
<Moment fromNow format="">2020-06-11T22:00:00.000Z</Moment>
Current workaround is to remove the global format setting and it then fromNow works, however we have to set the format on every other instance of Moment.
Additional information:
- package version 0.9.7
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels