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

RelativeTime plugin bug while using BadMutable plugin #1022

Closed
uniquemo opened this issue Aug 22, 2020 · 1 comment · Fixed by #1023
Closed

RelativeTime plugin bug while using BadMutable plugin #1022

uniquemo opened this issue Aug 22, 2020 · 1 comment · Fixed by #1023
Labels

Comments

@uniquemo
Copy link

uniquemo commented Aug 22, 2020

Describe the bug
When I use RelativeTime plugin with BadMutable plugin in my react project, I get wrong answer.

For Example: The time variable gets in infinity years instead of 4 months ago.

import React from 'react';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import badMutable from 'dayjs'/plugin/badMutable';

dayjs.extend(relativeTime);
dayjs.extend(badMutable);

const App = () => {
    // 1588262400000 stands for 2020-05-1
    const time = dayjs(new Date(1588262400000)).fromNow();
    return <div>{time}</div>
}

Expected behavior
As above, the time variable should be 4 months ago.

Information

  • Day.js Version: 1.8.34
  • OS: MAC
  • Browser: Chrome 83
  • Time zone: 2020-08-22 China Beijing
@iamkun
Copy link
Owner

iamkun commented Sep 2, 2020

🎉 This issue has been resolved in version 1.8.35 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants