You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 10, 2019. It is now read-only.
We are using react-intl intensively for internationalization. React-intl is internally using intl-relativeformat for calculating 'today' and 'yesterday'.
Intl-relativeformate incorrectly shows 'today' even if the datetime send to it was from yesterday for the following times.
Time Sent
Current Time
Relative
2017-09-06T18:29:30.314143+00:00
2017-09-067T04:29:30.314143+00:00
Today
2017-09-06T18:00:30.314143+00:00
2017-09-067T04:09:30.314143+00:00
Today
The code that I am talking about is:
file name : intl-relativeformat/src/diff.js
------------
var millisecond = round(to - from),
second = round(millisecond / 1000),
minute = round(second / 60),
hour = round(minute / 60),
day = round(hour / 24),
week = round(day / 7);
---------------
The issue can be easily solved by replacing the code with the below code
var millisecond = to - from,
second = millisecond / 1000,
minute = second / 60,
hour = minute / 60,
day = round(hour / 24),
week = round(day / 7);