dayjs / dayjs-website

⏰Day.js website repo
http://day.js.org/
MIT License
66 stars 227 forks source link

Updated Duration documentation #22

Closed stebogit closed 3 years ago

stebogit commented 4 years ago

Should you merge https://github.com/iamkun/dayjs/pull/1099 😜

iamkun commented 4 years ago

I prefer not to add this to the docs. It's a little wired syntax I think. 🤔

stebogit commented 4 years ago

You mean the way I phrased it or the actual new option?

iamkun commented 4 years ago

I think we should not tell our new user that we could add a duration directly.

And adding this feature is only for migration from moment.js.

stebogit commented 4 years ago

But if it is not in the docs, how would people migrating from moment learn this is available? Is there a "how to migrate from moment" document maybe?

iamkun commented 4 years ago

Cause moment support this, so we implement this. But this does not mean we should encourage our users to use this syntax.

I think a clear way for most users is to convert duration to milliseconds by our user and to added to the Dayjs instance.

iamkun commented 3 years ago

I'll close this since it's been a while since it's been opened. Feel free to reopen if you have updates on this