Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromNow ignores threshold #5017

Open
dilab-heartbeat opened this issue Feb 22, 2019 · 0 comments
Open

fromNow ignores threshold #5017

dilab-heartbeat opened this issue Feb 22, 2019 · 0 comments

Comments

@dilab-heartbeat
Copy link

dilab-heartbeat commented Feb 22, 2019

Describe the bug
A clear and concise description of what the bug is.

fromNow() prints 23 hours and 30 minutes as one day

To Reproduce
Steps to reproduce the behavior:

    moment.relativeTimeThreshold('s', 60);
    moment.relativeTimeThreshold('m', 60);
    moment.relativeTimeThreshold('h', 24);
    console.log(moment().subtract(23, 'hours').subtract(59, 'minute').fromNow())

prints a day ago

Expected behavior
should print 23 hours ago

Desktop:

  • OS: mac mojave
  • Browser Chromium
  • Version 73.0.3679.0 (Developer Build) (64-bit)

Moment-specific environment

  • The time zone setting of the machine the code is running on
    new Date().getTimeZoneOffset() prints -60
  • The time and date at which the code was run
    14:15:22 22.Feb.2019
  • Other libraries in use (TypeScript, Immutable.js, etc)
    Typescript - Angular - Karma

Please run the following code in your environment and include the output:

Fri Feb 22 2019 14:15:22 GMT+0100 (Central European Standard Time)
VM1515:2 2/22/2019, 2:15:22 PM
VM1515:3 -60
VM1515:4 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3679.0 Safari/537.36
2.24.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants