So basically what I need to do is detect when there has been a change in my day variable so I can trigger a custom event/function for something to happen. My day is an integer and gets reset to 1 at the end of every month. Is it possible to do this or will I need to come up with another solution?
Why don’t you just fire an event whenever your day variable changes?
Simply send the day integer to this event so you can have different behaviour for differetn days.
Whenever you need to change the day variable, instead of setting it directly; execute a function that changes the variable. Inside that function you also do queries.