iamkun / dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
https://day.js.org
MIT License
47.07k stars 2.31k forks source link

diff() is a manipulation function, not a display function #1387

Open Bilge opened 3 years ago

Bilge commented 3 years ago

Describe the bug In the docs, documentation for diff() is found under the difference topic, filed under the top-level heading, display. However, diffing is not concerned with the display of dates but of manipulating them, ergo it is misclassified.

Expected behavior Difference topic should be filed under manipulation heading.

Information n/a

iamkun commented 3 years ago

this manipulating section stores methods that could make a change to date time, while displaying is to display date-times in some way. And diff just tell you the difference between date-times rather than change them.