Days diffs are calculated based on the beginning of the day
Fixes #52
Because day diffs are calculated based on the time between the from and to day, rounded up or down, you could end up saying one day is "yesterday" when it really occurred 12 hours ago on the same day. To fix this we normalize the days to midnight in the current locale and then convert it into milliseconds to calculate the difference in days.
Test included to show that diff between midnight and 1 second before midnight should result in 'yesterday'
Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! :smile:
@okuryu pls review & merge, this is critical for business
It is a little more complicated that just this, read https://github.com/tc39/proposal-intl-relative-time/issues/9 for more details.