fetzerch / grafana-sunandmoon-datasource

SunAndMoon is a datasource plugin for Grafana that calculates the position of Sun and Moon as well as the Moon illumination. ☀️🌙🧛‍♂️
MIT License
42 stars 8 forks source link

fix for multiple annotations #2

Closed daniellee closed 8 years ago

daniellee commented 8 years ago

The range object is a Momentjs date object and is mutable so the .add(1, 'days') call changes the date range for the other annotations. This change clones the date object before adding a day. Definitely a subtle bug!

http://momentjs.com/docs/#/parsing/moment-clone/

fetzerch commented 8 years ago

Thanks much for the fix!