Closed LeivoSepp closed 1 year ago
Hello
I don't understand how it could give a month 13?
getMonth()
returns month index, so today it returns 10
and in december 11
. So +1 is 12.
Ahh, you are right. I think it was very late and my mathematics was upside down :)
Thanks for confirming!
I know the feeling 😄
https://github.com/jisotalo/shelly-porssisahko/blob/6675f1e020f5ac600561d55db1360f34e99f2668/src/shelly-porssisahko.js#L382 In December this formula gives a month 13. getMonth() + 1
1 Solution is to use something like this: month > 12 ? 1 : month
2 Solution is even better: new Date().toISOString().slice(0,10) + tadatada