dayjs / dayjs-website

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

fix: add reminder for setters that dayjs objects are immutable #72

Closed BePo65 closed 2 years ago

BePo65 commented 2 years ago

On occasion I stumbled about the fact that the setters don't change the object, but return a new one. The very first page of dayjs says so, but it took me a few seconds to remember, when searching for strange effects in my program 😄

iamkun commented 2 years ago

this seems a little redundant for all the APIs?

BePo65 commented 2 years ago

Of course you are right, but I made these changes, because users stumbled about the simple fact of immutability (I don't remember the issue number). So I thought it would be a good idea to repeat the fact in the documentation. Perhaps it helps preventing simple RTFM issues 😄

iamkun commented 2 years ago

cool, that sounds reasonable.