formatjs / formatjs-old

The monorepo home to all of the FormatJS related libraries.
https://formatjs.io/
156 stars 53 forks source link

Bug related to selectUnit #465

Closed mormubis closed 4 years ago

mormubis commented 4 years ago

Which package? intl-utils

Describe the bug selectUnit results in {"value": -1, "unit": "year"} after new years.

To Reproduce

selectUnit(new Date(2019, 10, 30), new Date(2020, 0, 16))
// {"value": 1, "unit": "year"}

Expected behavior

selectUnit(new Date(2019, 10, 30), new Date(2020, 0, 16))
// {"value": 1, "unit": "month"}
longlho commented 4 years ago

Thanks for the PR but we don't accept PRs to selectUnit since its output is entirely editorial and will break people. See https://github.com/formatjs/formatjs/tree/master/packages/intl-utils#caveats