gchenuet / nest-datagraph

Nest thermostat dashboard and graph charts
MIT License
36 stars 17 forks source link

Fix php / mysql date issue #8

Closed bkonings closed 7 years ago

bkonings commented 7 years ago

Old code:

date('n', strtotime("first day of -1 month", $phpdate)) This resulted in januari being calculated as December (month -1)

Changed to: (date('n', $phpdate)-1) This takes the month, outside of the date function then subtracts one, resulting in the correct google graph pointer for month(0-11) Since we no longer subtract one from the month inside the date function the first day of the month fix is also no longer required.

gchenuet commented 7 years ago

Thanks @bkonings for this PR. Really appreciate your help 👍